add cancel logic
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user