chore: add new features cabine & admin
This commit is contained in:
@@ -119,7 +119,7 @@ export const getCommandByID = async (commandId: number) => {
|
||||
|
||||
export const getCommandItems = async (commandId: number) => {
|
||||
const { data } = await apiClient.get(
|
||||
`${CABINE_URL}/commands/${commandId}/items`,
|
||||
`${V2}/admin/protected/orders/${commandId}/items`,
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
@@ -130,6 +130,13 @@ export const getCommandItems = async (commandId: number) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const deleteCommandItem = async (commandId: number, itemId: number) => {
|
||||
const { data } = await apiClient.delete(
|
||||
`${V2}/admin/protected/orders/${commandId}/items/${itemId}`,
|
||||
);
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
export const updateCommandStatus = async (
|
||||
commandId: number,
|
||||
newStatus: string,
|
||||
@@ -159,6 +166,13 @@ export const validateCommand = async (commandId: number) => {
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
export const notifyClientToDescend = async (commandId: number) => {
|
||||
const { data } = await apiClient.post(
|
||||
`${V2}/admin/protected/orders/${commandId}/notify-client`,
|
||||
);
|
||||
return { success: true, message: data.message, client_username: data.client_username };
|
||||
};
|
||||
|
||||
export const confirmReceptionAdmin = async (commandId: number) => {
|
||||
const { data } = await apiClient.post(
|
||||
`${V2}/admin/protected/orders/${commandId}/confirm-reception`,
|
||||
|
||||
Reference in New Issue
Block a user