Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add pagination

Steven Tey5274f9706dc5
diff --git a/apps/web/app/api/customers/route.ts b/apps/web/app/api/customers/route.ts
index ad40437392..a0acbca7bb 100644
--- a/apps/web/app/api/customers/route.ts
+++ b/apps/web/app/api/customers/route.ts
@@ -11,11 +11,15 @@ import { NextResponse } from "next/server";
// GET /api/customers – Get all customers
export const GET = withWorkspace(
- async ({ req, workspace }) => {
+ async ({ workspace }) => {
const customers = await prisma.customer.findMany({
where: {
projectId: workspace.id,
},
+ take: 100,
+ orderBy: {
+ createdAt: "asc",
+ },
});
return NextResponse.json(