order detail + change status in all state
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user