chore: add select
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user