loyalty & reward: initial commit
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
USER_DETAILS_URL,
|
||||
EGIFT_CARDS_URL,
|
||||
REDEEM_DETAILS_URL,
|
||||
LOYALTY_HISTORY_URL,
|
||||
} from "utils/constants";
|
||||
|
||||
import { OrderDetails } from "pages/checkout/hooks/types";
|
||||
@@ -182,6 +183,25 @@ export const branchApi = baseApi.injectEndpoints({
|
||||
return response.result;
|
||||
},
|
||||
}),
|
||||
getLoyaltyHistory: builder.query<
|
||||
{
|
||||
restaurant_id: number;
|
||||
restaurant_name: string;
|
||||
restaurant_icon: string;
|
||||
total_points: string;
|
||||
loyalty_stamp_image: string;
|
||||
loyalty_stamps: number;
|
||||
}[],
|
||||
void
|
||||
>({
|
||||
query: () => ({
|
||||
url: LOYALTY_HISTORY_URL,
|
||||
method: "GET",
|
||||
}),
|
||||
transformResponse: (response: any) => {
|
||||
return response.result.data.orders;
|
||||
},
|
||||
}),
|
||||
}),
|
||||
});
|
||||
export const {
|
||||
@@ -197,4 +217,5 @@ export const {
|
||||
useGetUserDetailsQuery,
|
||||
useGetEGiftCardsQuery,
|
||||
useGetRedeemDetailsQuery,
|
||||
useGetLoyaltyHistoryQuery,
|
||||
} = branchApi;
|
||||
|
||||
Reference in New Issue
Block a user