chore: build
This commit is contained in:
@@ -251,6 +251,13 @@ func (d *Database) UpdateSettings(s models.AppSettings) error {
|
|||||||
return fmt.Errorf("erreur sérialisation pools: %w", err)
|
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)
|
rewardJSON, err := json.Marshal(s.PointsReward)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("erreur sérialisation points_reward: %w", err)
|
return fmt.Errorf("erreur sérialisation points_reward: %w", err)
|
||||||
|
|||||||
@@ -2166,12 +2166,17 @@ export const unlinkTelegram = async (): Promise<void> => {
|
|||||||
// 🏆 POINTS — RÉCOMPENSES
|
// 🏆 POINTS — RÉCOMPENSES
|
||||||
// ============================================
|
// ============================================
|
||||||
|
|
||||||
|
export type RewardConfigProduct = {
|
||||||
|
product_id: number;
|
||||||
|
product_name: string;
|
||||||
|
quantity: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type RewardCategoryConfig = {
|
export type RewardCategoryConfig = {
|
||||||
category: string;
|
category: string;
|
||||||
type: "free_product" | "half_price_product";
|
type: "free_product" | "half_price_product";
|
||||||
all_products: boolean;
|
all_products: boolean;
|
||||||
product_ids: number[];
|
products: RewardConfigProduct[];
|
||||||
product_names: string[];
|
|
||||||
quantity: number;
|
quantity: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -452,18 +452,18 @@ function ConsultationHistorique() {
|
|||||||
</span>,
|
</span>,
|
||||||
]
|
]
|
||||||
: (
|
: (
|
||||||
cfg.product_names ??
|
cfg.products ??
|
||||||
[]
|
[]
|
||||||
).map(
|
).map(
|
||||||
(
|
(
|
||||||
name,
|
p,
|
||||||
) => (
|
) => (
|
||||||
<span
|
<span
|
||||||
key={`${cfg.category}-${name}`}
|
key={`${cfg.category}-${p.product_id}`}
|
||||||
className="reward-eligible-cat"
|
className="reward-eligible-cat"
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
name
|
p.product_name
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user