loyalty & reward: initial commit

This commit is contained in:
2026-01-13 06:24:25 +03:00
parent 69bc9d4dee
commit a06147dfa4
14 changed files with 873 additions and 25 deletions

View File

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