fix:allow item quantity changes only for pending orders
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
export const orderStatuses = ["pending", "processing", "shipped", "cancelled", "refunded"] as const;
|
||||
|
||||
export type OrderStatus = (typeof orderStatuses)[number];
|
||||
|
||||
// Item quantities can only be adjusted before fulfillment starts. Shared so the UI
|
||||
// matches the API rule; the API stays the authoritative check.
|
||||
export function canEditOrderItems(status: OrderStatus) {
|
||||
return status === "pending";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user