chore: update
This commit is contained in:
@@ -381,7 +381,8 @@ export const confirmReception = async (
|
|||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
message: "Commande confirmée avec succès",
|
message: "Commande confirmée avec succès",
|
||||||
points_earned: data.points_earned || 10,
|
points_earned: data.points_earned || 0,
|
||||||
|
category: data.category,
|
||||||
data,
|
data,
|
||||||
};
|
};
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|||||||
@@ -769,8 +769,9 @@ export interface ConfirmReceptionResponse {
|
|||||||
success: boolean;
|
success: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
points_earned?: number;
|
points_earned?: number;
|
||||||
|
category?: string; // 'total', 'zipette&co', 'weed&hash', 'mixed'
|
||||||
data?: {
|
data?: {
|
||||||
category?: string; // ✅ Catégorie de points ('zipette&co', 'weed&hash', etc.)
|
category?: string;
|
||||||
points_earned?: number;
|
points_earned?: number;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default function OrderHistoryScreen() {
|
|||||||
const [orders, setOrders] = useState<CompletedOrder[]>([]);
|
const [orders, setOrders] = useState<CompletedOrder[]>([]);
|
||||||
const [stats, setStats] = useState<ClientStats | null>(null);
|
const [stats, setStats] = useState<ClientStats | null>(null);
|
||||||
const [penalties, setPenalties] = useState<PenaltyInfo | 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 [referralBalance, setReferralBalance] = useState(0);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
|||||||
@@ -130,8 +130,13 @@ export default function OrderTrackingScreen() {
|
|||||||
try {
|
try {
|
||||||
const res = await confirmReception(orderId);
|
const res = await confirmReception(orderId);
|
||||||
if (res.success) {
|
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(
|
showToast(
|
||||||
`Livraison confirmee ! +${res.points_earned || 0} points`,
|
`Livraison confirmee ! +${res.points_earned || 0} points${catLabel}`,
|
||||||
"success",
|
"success",
|
||||||
);
|
);
|
||||||
fetchOrders();
|
fetchOrders();
|
||||||
|
|||||||
Reference in New Issue
Block a user