gift: update UI and voucher & items BS

This commit is contained in:
2025-12-30 11:09:52 +03:00
parent f3b8bdba63
commit 3ed5c4d5d6
17 changed files with 434 additions and 10 deletions

View File

@@ -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;