Skip to content

Commit 35382a3

Browse files
committed
fix(api): add missing users JOIN in public configs count query
1 parent bfc3863 commit 35382a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/api/configs/public/+server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const GET: RequestHandler = async ({ platform, url }) => {
8383
const countQuery = `
8484
SELECT COUNT(*) as count
8585
FROM configs c
86+
JOIN users u ON c.user_id = u.id
8687
WHERE ${whereClause}
8788
AND (
8889
c.install_count > 0
@@ -95,7 +96,7 @@ export const GET: RequestHandler = async ({ platform, url }) => {
9596
)
9697
)
9798
`;
98-
const countResult = await env.DB.prepare(countQuery).first<{ count: number }>();
99+
const countResult = await env.DB.prepare(countQuery).first<{ count: number}>();
99100
total = countResult?.count || 0;
100101
}
101102

0 commit comments

Comments
 (0)