chore: update

This commit is contained in:
2026-03-08 15:11:28 +01:00
parent 001cad7e61
commit 712d667d86
4 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -381,7 +381,8 @@ export const confirmReception = async (
return {
success: true,
message: "Commande confirmée avec succès",
points_earned: data.points_earned || 10,
points_earned: data.points_earned || 0,
category: data.category,
data,
};
} catch (error: any) {
+2 -1
View File
@@ -769,8 +769,9 @@ export interface ConfirmReceptionResponse {
success: boolean;
message: string;
points_earned?: number;
category?: string; // 'total', 'zipette&co', 'weed&hash', 'mixed'
data?: {
category?: string; // ✅ Catégorie de points ('zipette&co', 'weed&hash', etc.)
category?: string;
points_earned?: number;
[key: string]: any;
};
@@ -45,7 +45,7 @@ export default function OrderHistoryScreen() {
const [orders, setOrders] = useState<CompletedOrder[]>([]);
const [stats, setStats] = useState<ClientStats | null>(null);
const [penalties, setPenalties] = useState<PenaltyInfo | null>(null);
const [appSettings, setAppSettings] = useState<PublicSettings>({ penalties_enabled: true, show_amende_score: true, points_enabled: true, points_separated: true, referral_enabled: true });
const [appSettings, setAppSettings] = useState<PublicSettings>({ penalties_enabled: true, show_amende_score: true, points_enabled: true, points_separated: true, referral_enabled: false });
const [referralBalance, setReferralBalance] = useState(0);
const [loading, setLoading] = useState(true);
const [refreshing, setRefreshing] = useState(false);
@@ -130,8 +130,13 @@ export default function OrderTrackingScreen() {
try {
const res = await confirmReception(orderId);
if (res.success) {
const cat = res.category || '';
let catLabel = '';
if (cat === 'total') catLabel = ' (Total)';
else if (cat.includes('zipette')) catLabel = ' (Zipette&Co)';
else if (cat.includes('weed') || cat.includes('hash')) catLabel = ' (Weed&Hash)';
showToast(
`Livraison confirmee ! +${res.points_earned || 0} points`,
`Livraison confirmee ! +${res.points_earned || 0} points${catLabel}`,
"success",
);
fetchOrders();