chore: build
Backend - Build & Lint / build (push) Canceled after 21m42s
Frontend Web - Build & Lint / build (push) Successful in 13m5s

This commit is contained in:
Xor290
2026-08-30 15:24:17 +02:00
parent 6fca16a58c
commit 42ed11bc22
3 changed files with 18 additions and 6 deletions
+7
View File
@@ -251,6 +251,13 @@ func (d *Database) UpdateSettings(s models.AppSettings) error {
return fmt.Errorf("erreur sérialisation pools: %w", err)
}
if s.PointsReward != nil {
for i := range s.PointsReward.CategoryConfigs {
if s.PointsReward.CategoryConfigs[i].Products == nil {
s.PointsReward.CategoryConfigs[i].Products = []models.RewardProductQuantity{}
}
}
}
rewardJSON, err := json.Marshal(s.PointsReward)
if err != nil {
return fmt.Errorf("erreur sérialisation points_reward: %w", err)
+7 -2
View File
@@ -2166,12 +2166,17 @@ export const unlinkTelegram = async (): Promise<void> => {
// 🏆 POINTS — RÉCOMPENSES
// ============================================
export type RewardConfigProduct = {
product_id: number;
product_name: string;
quantity: number;
};
export type RewardCategoryConfig = {
category: string;
type: "free_product" | "half_price_product";
all_products: boolean;
product_ids: number[];
product_names: string[];
products: RewardConfigProduct[];
quantity: number;
};
@@ -452,18 +452,18 @@ function ConsultationHistorique() {
</span>,
]
: (
cfg.product_names ??
cfg.products ??
[]
).map(
(
name,
p,
) => (
<span
key={`${cfg.category}-${name}`}
key={`${cfg.category}-${p.product_id}`}
className="reward-eligible-cat"
>
{
name
p.product_name
}
</span>
),