fix broken build,

This commit is contained in:
louiscklaw
2025-06-13 18:11:12 +08:00
parent 5ff3393f54
commit d767108fcf
18 changed files with 130 additions and 82 deletions

View File

@@ -28,7 +28,7 @@ export async function POST(req: NextRequest) {
try {
const order = await createOrder(data);
return response(order, STATUS.CREATED);
return response(order, STATUS.OK);
} catch (error) {
return handleError('Order - Create', error);
}
@@ -48,7 +48,7 @@ export async function PUT(req: NextRequest) {
if (!orderId) throw new Error('orderId cannot be null');
const id: number = parseInt(orderId);
const updatedOrder = await updateOrder(id, data);
const updatedOrder = await updateOrder(id.toString(), data);
return response(updatedOrder, STATUS.OK);
} catch (error) {
return handleError('Order - Update', error);
@@ -68,7 +68,7 @@ export async function DELETE(req: NextRequest) {
if (!orderId) throw new Error('orderId cannot be null');
const id: number = parseInt(orderId);
await deleteOrder(id);
await deleteOrder(id.toString());
return response({ success: true }, STATUS.OK);
} catch (error) {
return handleError('Order - Delete', error);