chore: fix recompense categorie
Backend - Build & Lint / build (push) Has been cancelled
Frontend Client - EAS Build / build (push) Failing after 2h1m17s
Frontend Web - Build & Lint / build (push) Failing after 16m7s

This commit is contained in:
Nuxgrid
2026-07-18 16:41:42 +02:00
parent d6f5f2b1f2
commit dfa432862a
6 changed files with 156 additions and 47 deletions
+8 -7
View File
@@ -2172,6 +2172,13 @@ export type RewardCategoryConfig = {
amount: number;
};
export type RewardItemConfig = {
product_id: number;
product_name: string;
quantity: number;
price: number;
};
export type PointsPoolInfo = {
key: string;
name: string;
@@ -2180,13 +2187,7 @@ export type PointsPoolInfo = {
rewards_claimed: number;
rewards_available: number;
eligible_configs: RewardCategoryConfig[];
};
export type RewardItemConfig = {
product_id: number;
product_name: string;
quantity: number;
price: number;
eligible_reward_items: RewardItemConfig[];
};
export type PointsRewardConfig = {
@@ -180,7 +180,7 @@ function ConsultationHistorique() {
// Ouvre la modal de choix si plusieurs produits sont éligibles,
// sinon réclame directement (1 seul produit configuré ou aucun item).
const openRewardModal = (pool: PointsPoolInfo) => {
const items = pointsRewards?.reward?.reward_items ?? [];
const items = pool.eligible_reward_items ?? [];
if (items.length > 1) {
setSelectedProductId(items[0]?.product_id ?? null);
setRewardModalPool(pool);
@@ -716,7 +716,7 @@ function ConsultationHistorique() {
</p>
<div className="reward-modal-products">
{(pointsRewards.reward.reward_items ?? []).map(
{(rewardModalPool.eligible_reward_items ?? []).map(
(item) => {
const isSelected =
selectedProductId === item.product_id;