summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/api/location/route.tsx3
-rw-r--r--src/app/api/product/route.tsx3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/app/api/location/route.tsx b/src/app/api/location/route.tsx
index 7139c6d..1b5cb43 100644
--- a/src/app/api/location/route.tsx
+++ b/src/app/api/location/route.tsx
@@ -17,7 +17,8 @@ export async function GET(request: NextRequest) {
companyId,
name: { mode: 'insensitive', contains: search ?? '' }
},
- take: 20
+ take: 20,
+ orderBy: { name: 'asc' }
})
return NextResponse.json(locations)
diff --git a/src/app/api/product/route.tsx b/src/app/api/product/route.tsx
index d28a543..1a28315 100644
--- a/src/app/api/product/route.tsx
+++ b/src/app/api/product/route.tsx
@@ -32,7 +32,8 @@ export async function GET(request: NextRequest) {
where,
include: { company: true },
take: PAGE_SIZE,
- skip: (intPage - 1) * PAGE_SIZE
+ skip: (intPage - 1) * PAGE_SIZE,
+ orderBy: { name: 'asc' }
})
const count = await prisma.product.count({ where })