diff --git a/frontend-admin/src/screens/cabine/OrdersScreen.tsx b/frontend-admin/src/screens/cabine/OrdersScreen.tsx index 24e304b0..93419b69 100644 --- a/frontend-admin/src/screens/cabine/OrdersScreen.tsx +++ b/frontend-admin/src/screens/cabine/OrdersScreen.tsx @@ -20,7 +20,6 @@ import { notifyClientToDescendCabine, getCabineLivreursList, assignDeliveryPersonByCabine, - resetClientPoints, proposeAddressChangeCabine, } from "../../api/api_cabine"; import type { CommandResponse } from "../../api/types"; @@ -166,23 +165,6 @@ 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( @@ -457,11 +439,6 @@ 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, diff --git a/frontend-admin/src/screens/cabine/UsersScreen.tsx b/frontend-admin/src/screens/cabine/UsersScreen.tsx index 30d663d4..4092076b 100644 --- a/frontend-admin/src/screens/cabine/UsersScreen.tsx +++ b/frontend-admin/src/screens/cabine/UsersScreen.tsx @@ -73,6 +73,22 @@ export default function UsersScreen() { ); }; + const handleResetZipette = (username: string) => { + showConfirm( + "Reset points zipette", + `Réinitialiser les points zipette de ${username} ?`, + async () => { + try { + await resetClientPoints(username, true); + await loadData(); + } catch (e: any) { + showError("Erreur", e.message); + } + }, + "Reset", + ); + }; + const styles = useMemo( () => StyleSheet.create({ @@ -154,6 +170,12 @@ export default function UsersScreen() { size="sm" variant="outline" /> +