gift: update UI and voucher & items BS
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
RESTAURANT_DETAILS_URL,
|
||||
TABLES_URL,
|
||||
USER_DETAILS_URL,
|
||||
EGIFT_CARDS_URL,
|
||||
} from "utils/constants";
|
||||
|
||||
import { OrderDetails } from "pages/checkout/hooks/types";
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
UserType,
|
||||
} from "utils/types/appTypes";
|
||||
import { baseApi } from "./apiSlice";
|
||||
import { EGiftCard } from "pages/EGiftCards/type";
|
||||
|
||||
export const branchApi = baseApi.injectEndpoints({
|
||||
endpoints: (builder) => ({
|
||||
@@ -31,7 +33,7 @@ export const branchApi = baseApi.injectEndpoints({
|
||||
},
|
||||
}),
|
||||
transformResponse: (response: any) => {
|
||||
return response?.result?.restaurants?.[0]
|
||||
return response?.result?.restaurants?.[0];
|
||||
},
|
||||
providesTags: ["Restaurant"],
|
||||
}),
|
||||
@@ -160,6 +162,15 @@ export const branchApi = baseApi.injectEndpoints({
|
||||
}),
|
||||
invalidatesTags: ["Orders", "Restaurant"],
|
||||
}),
|
||||
getEGiftCards: builder.query<EGiftCard[], void>({
|
||||
query: () => ({
|
||||
url: EGIFT_CARDS_URL,
|
||||
method: "GET",
|
||||
}),
|
||||
transformResponse: (response: any) => {
|
||||
return response.result;
|
||||
},
|
||||
}),
|
||||
}),
|
||||
});
|
||||
export const {
|
||||
@@ -173,4 +184,5 @@ export const {
|
||||
useGetDiscountMutation,
|
||||
useRateOrderMutation,
|
||||
useGetUserDetailsQuery,
|
||||
useGetEGiftCardsQuery,
|
||||
} = branchApi;
|
||||
|
||||
Reference in New Issue
Block a user