Skip to content

Commit 312986d

Browse files
committed
Fix a bug where empty profile responded with 404
1 parent abad5c3 commit 312986d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/profile/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ profile.get<"/:handle">(async (c) => {
6060
),
6161
);
6262
const maxPage = Math.ceil(totalPosts / PAGE_SIZE);
63-
if (page > maxPage) {
63+
if (page > maxPage && !(page <= 1 && totalPosts < 1)) {
6464
return c.notFound();
6565
}
6666
const postList = await db.query.posts.findMany({

0 commit comments

Comments
 (0)