diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index ca1b4c8..c688c9f 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -79,20 +79,12 @@ export class DelivererTable implements OnInit { } try { - const deliverers = updateDelivererComponent.delivererForm.getRawValue(); await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers)) - this.notificationService.success( - 'Success', - 'Transporteur modifié' - ) + this.notificationService.success('Success', 'Transporteur modifié') } catch (e) { - console.error(e); - this.notificationService.error( - 'Erreur', - 'Erreur lors de la modification' - ) + this.notificationService.error('Erreur', 'Erreur lors de la modification') } } diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 205c26f..4a31036 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -116,25 +116,6 @@ export class DelivereryNoteTable implements OnInit { this.deliveryNotesLoading.set(false) } - selectedDeliveryNote: GetDeliveryNoteDto | null = null; - openEditModal(deliveryNote: GetDeliveryNoteDto) { - this.selectedDeliveryNote = { ...deliveryNote }; - this.modal().showModal(); - } - - async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) { - if (!this.selectedDeliveryNote) return; - - await this.edit(id, updateDelivereryNoteComponent); - updateDelivereryNoteComponent.deliveryNoteForm.reset(); - modal.isVisible = false; - await this.fetchDeliveryNotes(); - } - - onModalCancel(modal: ModalNav) { - modal.isVisible = false; - } - async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) { if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) { this.notificationService.error('Erreur', 'Formulaire invalide'); @@ -176,4 +157,22 @@ export class DelivereryNoteTable implements OnInit { } } + selectedDeliveryNote: GetDeliveryNoteDto | null = null; + openEditModal(deliveryNote: GetDeliveryNoteDto) { + this.selectedDeliveryNote = { ...deliveryNote }; + this.modal().showModal(); + } + + async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) { + if (!this.selectedDeliveryNote) return; + + await this.edit(id, updateDelivereryNoteComponent); + updateDelivereryNoteComponent.deliveryNoteForm.reset(); + modal.isVisible = false; + await this.fetchDeliveryNotes(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } } diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index 0ca8812..b0b4420 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,11 +1,11 @@ -
diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index 0e7a39c..a6aa2b6 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; -import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; +import {GetQuotationDto} from "../../services/api"; @Component({ selector: 'app-quotation-form', @@ -22,8 +22,20 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; styleUrl: './quotation-form.css', }) export class QuotationForm { - QuotationForm: FormGroup = new FormGroup({ - quotationMessage: new FormControl