mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Fix issue where commercial processed status incorrectly retained on update
Implement Zod validation on PUT /avoirs/:id endpoint to ensure correct data handling for commercialProcessed field, defaulting it to false and logging validation errors. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/2DtJTqh
This commit is contained in:
1 parent
4129ae68d0
commit
80b9d387c7
2 files changed
+16
-2
No files matched your search
@@ -88,7 +88,7 @@ const avoirSchema = z.object({
|
||||
})
|
||||
]).optional(),
|
||||
comment: z.string().optional(),
|
||||
commercialProcessed: z.boolean().optional(),
|
||||
commercialProcessed: z.boolean().default(false),
|
||||
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).optional(),
|
||||
});
|
||||
|
||||
@@ -272,6 +272,11 @@ export default function Avoirs() {
|
||||
// Handle edit form submission
|
||||
const onEditSubmit = (data: AvoirFormData) => {
|
||||
if (selectedAvoir) {
|
||||
console.log('💰 Editing avoir - Form data sent:', {
|
||||
originalCommercial: selectedAvoir.commercialProcessed,
|
||||
formCommercial: data.commercialProcessed,
|
||||
fullData: data
|
||||
});
|
||||
editAvoirMutation.mutate({ id: selectedAvoir.id, data });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user