Files
dashboards/src/lib/customer-orders-api.ts
T
Alireza HassaniandCursor 68365457a1 Fix auth login flow, Iran Yekan/Doran fonts, and account tiles.
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>
2026-09-26 11:10:37 +03:30

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}`);
}