update delivery note form

This commit is contained in:
2025-12-11 17:48:54 +01:00
parent dfaea894e4
commit 586c9458b1
6 changed files with 103 additions and 2 deletions

View File

@@ -145,8 +145,19 @@ export class DelivereryNoteTable implements OnInit {
}
try {
const estimateDate = updateDelivereryNoteComponent.deliveryNoteForm.get('estimatedDate').value;
const expeditionDate = updateDelivereryNoteComponent.deliveryNoteForm.get('expeditionDate').value;
const realDate = updateDelivereryNoteComponent.deliveryNoteForm.get('realDeliveryDate').value;
const estimateDateResult = format(estimateDate, 'yyyy-MM-dd');
const expeditionDateResult = format(expeditionDate, 'yyyy-MM-dd');
const realDateResult = format(realDate, 'yyyy-MM-dd');
const deliveryNotes = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue();
deliveryNotes.estimatedDate = estimateDateResult;
deliveryNotes.expeditionDate = expeditionDateResult;
deliveryNotes.realDeliveryDate = realDateResult;
await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNotes))
this.notificationService.success(
@@ -154,7 +165,6 @@ export class DelivereryNoteTable implements OnInit {
'Bon de livraison modifié'
)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'