Skip to content

Commit

Permalink
perf(api): ⚡ using "distinct" to avoid duplicate rows
Browse files Browse the repository at this point in the history
  • Loading branch information
julianYaman committed Jul 4, 2022
1 parent a97624a commit fed285e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/getEntries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const handler = async function (
},
collaboration_partners: true,
tool_images: true,
votes: true,
_count: {
select: {
votes: true
Expand All @@ -63,6 +62,7 @@ const handler = async function (
},
skip: ((parseInt(params.page?.toString() || "1") - 1) * 10) || 0,
take: 10,
distinct: ["id"],
where: {
isVerified: true
},
Expand Down

1 comment on commit fed285e

@vercel
Copy link

@vercel vercel bot commented on fed285e Jul 4, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

tooldb – ./

tooldb-git-main-julianyaman.vercel.app
tooldb.vercel.app
tooldb-julianyaman.vercel.app
tooldb.dev

Please sign in to comment.