Skip to content

Commit

Permalink
chore: added all selected columns to the groupBy function (#1054)
Browse files Browse the repository at this point in the history
* chore: added all selected columns to the groupBy function

* chore: updated drizzle orm dep and tested it works
  • Loading branch information
JohnAllenTech authored Oct 4, 2024
1 parent 02e80c0 commit 017081e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"atropos": "^2.0.2",
"clsx": "^2.1.1",
"copy-to-clipboard": "^3.3.3",
"drizzle-orm": "^0.31.2",
"drizzle-orm": "^0.33.0",
"fathom-client": "^3.7.2",
"framer-motion": "^10.18.0",
"highlight.js": "^11.10.0",
Expand Down
12 changes: 11 additions & 1 deletion server/api/router/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,17 @@ export const postRouter = createTRPCRouter({
cursor ? paginationMapping[sort].cursor : undefined,
),
)
.groupBy(post.id, bookmarked.id, user.id)
.groupBy(
post.id,
post.slug,
post.title,
post.excerpt,
post.published,
post.readTimeMins,
post.likes,
bookmarked.id,
user.id,
)
.limit(limit + 1)
.orderBy(paginationMapping[sort].orderBy);

Expand Down

0 comments on commit 017081e

Please sign in to comment.