order detail + change status in all state

This commit is contained in:
hamid zarghami
2025-12-20 14:33:19 +03:30
parent 566c4cb97b
commit de8815f0d8
13 changed files with 1065 additions and 300 deletions
+27
View File
@@ -9,6 +9,14 @@ export interface GetOrdersParams {
deliveryType?: string;
}
export interface ChangeOrderStatusParams {
description?: string;
}
export interface RefundPaymentParams {
description: string;
}
export const getOrders = async (
params?: GetOrdersParams
): Promise<GetOrdersResponse> => {
@@ -30,3 +38,22 @@ export const getOrderById = async (
export const confirmOrder = async (orderId: string): Promise<void> => {
await axios.patch(`/admin/orders/${orderId}/confirm`);
};
export const verifyCashPayment = async (paymentId: string): Promise<void> => {
await axios.post(`/admin/payments/verify-cash-method/${paymentId}`);
};
export const changeOrderStatus = async (
orderId: string,
status: string,
params?: ChangeOrderStatusParams
): Promise<void> => {
await axios.patch(`/admin/orders/${orderId}/${status}`, params);
};
export const refundPayment = async (
orderId: string,
params: RefundPaymentParams
): Promise<void> => {
await axios.post(`/admin/orders/${orderId}/refund`, params);
};