Skip to content

Commit

Permalink
Fix release pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed May 28, 2024
1 parent 121cc5e commit f319d85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions website/app/components/changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ import type { ReactElement } from 'react';
export const Changelog = async (): Promise<ReactElement> => {
const changelog = await getChangelog();

const releasesByDay = changelog.data.reduce<
Record<string, typeof changelog.data>
>((acc, release) => {
const date = new Date(release.created_at).toDateString();
if (!(date in acc)) {
acc[date] = [];
}
acc[date].push(release);
return acc;
}, {});
const releasesByDay = changelog.reduce<Record<string, typeof changelog>>(
(acc, release) => {
const date = new Date(release.created_at).toDateString();
if (!(date in acc)) {
acc[date] = [];
}
acc[date].push(release);
return acc;
},
{}
);

return (
<div className="relative md:overflow-y-auto md:h-screen py-20 px-4">
Expand Down
2 changes: 1 addition & 1 deletion website/lib/octokit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getRepo = async () =>
});

export const getChangelog = async () =>
octokit.rest.repos.listReleases({
octokit.paginate(octokit.rest.repos.listReleases, {
owner,
repo,
per_page: 100,
Expand Down

0 comments on commit f319d85

Please sign in to comment.