From 51a3426cf3e792c806982fe6499429e33edd3d44 Mon Sep 17 00:00:00 2001 From: Xor290 Date: Fri, 6 Mar 2026 18:49:22 +0100 Subject: [PATCH] chore: add select --- .../src/screens/cabine/OrdersScreen.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/frontend-admin/src/screens/cabine/OrdersScreen.tsx b/frontend-admin/src/screens/cabine/OrdersScreen.tsx index 2580f626..5101a543 100644 --- a/frontend-admin/src/screens/cabine/OrdersScreen.tsx +++ b/frontend-admin/src/screens/cabine/OrdersScreen.tsx @@ -19,6 +19,7 @@ import { notifyClientToDescendCabine, getCabineLivreursList, assignDeliveryPersonByCabine, + resetClientPoints, } from "../../api/api_cabine"; import type { CommandResponse } from "../../api/types"; import StatusBadge from "../../components/StatusBadge"; @@ -147,6 +148,23 @@ export default function OrdersScreen() { } }; + const handleResetPoints = (clientUsername: string) => { + setOpenMenuId(null); + showConfirm( + "Reset points zipette", + `Réinitialiser les points zipette du client ${clientUsername} ?`, + async () => { + try { + await resetClientPoints(clientUsername, true); + showSuccess("Points réinitialisés", `Les points de ${clientUsername} ont été remis à zéro`); + } catch (e: any) { + showError("Erreur", e.message); + } + }, + "Réinitialiser", + ); + }; + const handleDelete = (commandId: number) => { setOpenMenuId(null); showConfirm( @@ -394,6 +412,11 @@ export default function OrdersScreen() { onPress: () => handleConfirmReception(item.id), condition: item.status === "livre", }, + { + label: "Reset points zipette", + icon: "star-outline" as keyof typeof Ionicons.glyphMap, + onPress: () => handleResetPoints(item.username), + }, { label: "Supprimer", icon: "trash-outline" as keyof typeof Ionicons.glyphMap,