diff --git a/client/src/components/NewSaleForm.tsx b/client/src/components/NewSaleForm.tsx index 1a8e823..1ef9b9e 100644 --- a/client/src/components/NewSaleForm.tsx +++ b/client/src/components/NewSaleForm.tsx @@ -85,10 +85,13 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { const onSubmit = async (data: FormData) => { try { setIsSubmitting(true); + console.log('Form data being submitted:', data); + console.log('Form errors:', form.formState.errors); // Validate required fields const missingFields = validateRequiredFields(data); if (missingFields.length > 0) { + console.log('Missing fields found:', missingFields); toast({ title: "Champs manquants", description: `Veuillez remplir: ${missingFields.join(', ')}`, @@ -527,13 +530,31 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { - {/* Form Actions */} -