redeem: integration
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
TABLES_URL,
|
||||
USER_DETAILS_URL,
|
||||
EGIFT_CARDS_URL,
|
||||
REDEEM_DETAILS_URL,
|
||||
} from "utils/constants";
|
||||
|
||||
import { OrderDetails } from "pages/checkout/hooks/types";
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
} from "utils/types/appTypes";
|
||||
import { baseApi } from "./apiSlice";
|
||||
import { EGiftCard } from "pages/EGiftCards/type";
|
||||
import { RedeemResponse } from "pages/redeem/types";
|
||||
|
||||
export const branchApi = baseApi.injectEndpoints({
|
||||
endpoints: (builder) => ({
|
||||
@@ -171,6 +173,15 @@ export const branchApi = baseApi.injectEndpoints({
|
||||
return response.result;
|
||||
},
|
||||
}),
|
||||
getRedeemDetails: builder.query<RedeemResponse, string>({
|
||||
query: (voucherId: string) => ({
|
||||
url: `${REDEEM_DETAILS_URL}/${voucherId}`,
|
||||
method: "GET",
|
||||
}),
|
||||
transformResponse: (response: any) => {
|
||||
return response.result;
|
||||
},
|
||||
}),
|
||||
}),
|
||||
});
|
||||
export const {
|
||||
@@ -185,4 +196,5 @@ export const {
|
||||
useRateOrderMutation,
|
||||
useGetUserDetailsQuery,
|
||||
useGetEGiftCardsQuery,
|
||||
useGetRedeemDetailsQuery,
|
||||
} = branchApi;
|
||||
|
||||
Reference in New Issue
Block a user