feat(spa): add order history and automatic address book

This commit is contained in:
Your Name committed 2026-06-06 19:29:19 +07:00
1 parent 15cb147c81
commit ca31564ee7
3 files changed
+126 -31

No files matched your search

+7
View File
@@ -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;