mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-17 04:06:44 +02:00
1 file changed
+3
-29
@@ -14,7 +14,6 @@ import { Check, X } from "lucide-react";
|
||||
|
||||
const validateDeliverySchema = z.object({
|
||||
blNumber: z.string().min(1, "Le numéro de bon de livraison est obligatoire"),
|
||||
blAmount: z.string().optional(),
|
||||
});
|
||||
|
||||
type ValidateDeliveryForm = z.infer<typeof validateDeliverySchema>;
|
||||
@@ -39,20 +38,14 @@ export default function ValidateDeliveryModal({
|
||||
resolver: zodResolver(validateDeliverySchema),
|
||||
defaultValues: {
|
||||
blNumber: "",
|
||||
blAmount: "",
|
||||
},
|
||||
});
|
||||
|
||||
const validateDeliveryMutation = useMutation({
|
||||
mutationFn: async (data: ValidateDeliveryForm) => {
|
||||
const payload: any = {};
|
||||
|
||||
// Le blNumber est maintenant obligatoire
|
||||
payload.blNumber = data.blNumber.trim();
|
||||
|
||||
if (data.blAmount && data.blAmount.trim() !== '') {
|
||||
payload.blAmount = parseFloat(data.blAmount);
|
||||
}
|
||||
const payload = {
|
||||
blNumber: data.blNumber.trim()
|
||||
};
|
||||
|
||||
await apiRequest(`/api/deliveries/${delivery.id}/validate`, "POST", payload);
|
||||
},
|
||||
@@ -147,25 +140,6 @@ export default function ValidateDeliveryModal({
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Montant BL */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="blAmount"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Montant BL (€) - Optionnel</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="number"
|
||||
step="0.01"
|
||||
placeholder="Ex: 1200.00 (à remplir plus tard si nécessaire)"
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex justify-end space-x-3 pt-4">
|
||||
|
||||
Reference in new issue
Block a user