Prevent stale /auth/me from wiping a fresh session, unblock login submit, allow localhost HMR, and drop the tile "مشاهده" CTA. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
619 B
TypeScript
30 lines
619 B
TypeScript
import { api } from "@/lib/api";
|
|
|
|
export type CustomerOrderItem = {
|
|
id: string;
|
|
nameFa: string;
|
|
variantLabel: string | null;
|
|
quantity: number;
|
|
unitPrice: number;
|
|
storeId: string;
|
|
};
|
|
|
|
export type CustomerOrder = {
|
|
id: string;
|
|
status: string;
|
|
itemCount: number;
|
|
totalAmount: number;
|
|
note: string;
|
|
createdAt: string;
|
|
items: CustomerOrderItem[];
|
|
fulfillments: { id: string; storeId: string; status: string }[];
|
|
};
|
|
|
|
export function fetchMyOrders() {
|
|
return api<CustomerOrder[]>("/orders/mine");
|
|
}
|
|
|
|
export function fetchMyOrder(id: string) {
|
|
return api<CustomerOrder>(`/orders/mine/${id}`);
|
|
}
|