chore: add new features cabine & admin

This commit is contained in:
2026-03-06 11:47:19 +01:00
parent 0dff4ea4f0
commit 7c739f0a64
5 changed files with 112 additions and 3 deletions
+15 -1
View File
@@ -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`,