feat(spa): add order history and automatic address book
This commit is contained in:
1 parent
15cb147c81
commit
ca31564ee7
3 files changed
+126
-31
No files matched your search
@@ -123,6 +123,13 @@ export const ordersRoute = new Elysia({ prefix: "/orders" })
|
||||
paymentSlipUrl: t.String()
|
||||
})
|
||||
})
|
||||
.get("/customer/:customerId", async ({ params: { customerId } }) => {
|
||||
return await prisma.order.findMany({
|
||||
where: { customerId: Number(customerId) },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
include: { items: true }
|
||||
});
|
||||
})
|
||||
.post("/track", async ({ body, set }) => {
|
||||
try {
|
||||
const { orderId, phone } = body as any;
|
||||
|
||||
Reference in new issue
Block a user