chore: build
Frontend Admin - EAS Build / build (push) Has been cancelled
Frontend Client - EAS Build / build (push) Has been cancelled

This commit is contained in:
2026-06-20 21:17:59 +02:00
parent 768de08f87
commit 403e765a51
4 changed files with 35 additions and 18 deletions
+18 -9
View File
@@ -420,10 +420,6 @@ export const respondToAddressProposal = async (
}
};
// ============================================
// TRACKING
// ============================================
export const getOrderTracking = async (
commandId: number,
): Promise<TrackingResponse> => {
@@ -984,7 +980,10 @@ export const getMyPointsRewards = async (): Promise<{
}
};
export const claimMyReward = async (poolKey: string, productId?: number): Promise<{
export const claimMyReward = async (
poolKey: string,
productId?: number,
): Promise<{
success: boolean;
description?: string;
remaining_rewards?: number;
@@ -993,7 +992,9 @@ export const claimMyReward = async (poolKey: string, productId?: number): Promis
error?: string;
}> => {
try {
const body: { pool_key: string; product_id?: number } = { pool_key: poolKey };
const body: { pool_key: string; product_id?: number } = {
pool_key: poolKey,
};
if (productId !== undefined) body.product_id = productId;
const { data } = await apiClient.post(`${V1}/points/claim`, body);
return {
@@ -1014,7 +1015,10 @@ export const submitLivreurRating = async (
comment: string,
): Promise<{ success: boolean; error?: string }> => {
try {
await apiClient.post(`${V1}/orders/${orderId}/rate`, { rating, comment });
await apiClient.post(`${V1}/orders/${orderId}/rate`, {
rating,
comment,
});
return { success: true };
} catch (e: any) {
return { success: false, error: e?.response?.data?.error || "Erreur" };
@@ -1033,11 +1037,16 @@ export const getOrderRatingStatus = async (
};
export const calculateOrderTotal = (order: any): number => {
if (typeof order.total_prix === "number" && order.total_prix > 0) return order.total_prix;
if (typeof order.total_prix === "number" && order.total_prix > 0)
return order.total_prix;
if (typeof order.total === "number" && order.total > 0) return order.total;
if (Array.isArray(order.items) && order.items.length > 0) {
return order.items.reduce((sum: number, item: any) => {
return sum + (item.prix || item.price || 0) * (item.quantite || item.quantity || 1);
return (
sum +
(item.prix || item.price || 0) *
(item.quantite || item.quantity || 1)
);
}, 0);
}
return 0;