add cancel logic

This commit is contained in:
2025-10-18 16:32:30 +03:00
parent a5418b3724
commit 6214e2c0f5
3 changed files with 37 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
import {
CANCEL_ORDER_URL,
CREATE_ORDER_URL,
ORDER_DETAILS_URL,
ORDERS_URL,
@@ -46,6 +47,14 @@ export const branchApi = baseApi.injectEndpoints({
}),
invalidatesTags: ["Orders"],
}),
cancelOrder: builder.mutation({
query: (body: any) => ({
url: CANCEL_ORDER_URL,
method: "POST",
body,
}),
invalidatesTags: ["Orders"],
}),
getTables: builder.query<
any,
{ restaurantID: string; tableType: string }
@@ -89,4 +98,5 @@ export const {
useGetOrdersQuery,
useGetTablesQuery,
useGetOrderDetailsQuery,
useCancelOrderMutation
} = branchApi;