Skip to content

feat: parameter from cont to page and add newer link for pagination#105

Merged
dahlia merged 4 commits intofedify-dev:mainfrom
yamanoku:feature/rename-cont-to-page
Feb 9, 2025
Merged

feat: parameter from cont to page and add newer link for pagination#105
dahlia merged 4 commits intofedify-dev:mainfrom
yamanoku:feature/rename-cont-to-page

Conversation

@yamanoku
Copy link
Contributor

@yamanoku yamanoku commented Feb 8, 2025

resolve #104

Newer and Older links exist on the second and subsequent pages

Comment on lines 53 to 62
const totalPosts = await db.query.posts.findMany({
where: and(
eq(posts.accountId, owner.id),
or(eq(posts.visibility, "public"), eq(posts.visibility, "unlisted")),
),
});
const maxPage = Math.ceil(totalPosts.length / PAGE_SIZE);
if (page > maxPage) {
return c.notFound();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error that occurs when ?page exceeds the total number of pages.

404 not founds screenshots

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fair enough.

@yamanoku yamanoku marked this pull request as ready for review February 8, 2025 11:05
Copy link
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I left a few review comments, so please take a look!

Comment on lines 53 to 62
const totalPosts = await db.query.posts.findMany({
where: and(
eq(posts.accountId, owner.id),
or(eq(posts.visibility, "public"), eq(posts.visibility, "unlisted")),
),
});
const maxPage = Math.ceil(totalPosts.length / PAGE_SIZE);
if (page > maxPage) {
return c.notFound();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fair enough.

Copy link
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good now! Thanks!

@dahlia dahlia merged commit 2c509b8 into fedify-dev:main Feb 9, 2025
4 checks passed
@yamanoku yamanoku deleted the feature/rename-cont-to-page branch February 9, 2025 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a link to return to the previous page

2 participants