From b54ba70c11cfc5a54c54ac940933acc148005160 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 28 Nov 2025 09:00:41 +0100 Subject: [PATCH] fixed errors in supplier page --- src/app/components/supplier-form/supplier-form.html | 11 ++++++++++- src/app/components/supplier-form/supplier-form.ts | 5 ++++- src/app/components/supplier-table/supplier-table.html | 9 ++++++--- src/app/components/supplier-table/supplier-table.ts | 1 - src/app/pages/supplier/supplier.html | 2 +- src/app/pages/supplier/supplier.ts | 4 ++-- src/app/services/api/.openapi-generator/FILES | 1 + src/app/services/api/api.base.service.ts | 2 +- 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/app/components/supplier-form/supplier-form.html b/src/app/components/supplier-form/supplier-form.html index 8702c8d..ed44a1a 100644 --- a/src/app/components/supplier-form/supplier-form.html +++ b/src/app/components/supplier-form/supplier-form.html @@ -36,6 +36,15 @@ + + + Code Postal + + + + + + Ville @@ -50,7 +59,7 @@ Délai Moyen - + diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts index 2341018..c3cc539 100644 --- a/src/app/components/supplier-form/supplier-form.ts +++ b/src/app/components/supplier-form/supplier-form.ts @@ -27,11 +27,13 @@ export class SupplierForm { email: new FormControl(null, [Validators.required]), phone: new FormControl(null, [Validators.required]), address: new FormControl(null, [Validators.required]), + zipCode: new FormControl(null, [Validators.required]), city: new FormControl(null, [Validators.required]), deliveryDelay: new FormControl(null, [Validators.required]), }) - supplier= input.required(); + + supplier= input(); constructor() { effect(() => { if (this.supplier()) { @@ -40,6 +42,7 @@ export class SupplierForm { email: this.supplier().email, phone: this.supplier().phone, address: this.supplier().address, + zipCode: this.supplier().zipCode, city: this.supplier().city, deliveryDelay: this.supplier().deliveryDelay, }); diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 7a9cb69..33d127f 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -4,10 +4,13 @@ Nom - Prénom + Téléphone Email - Anniversaire - Emprunt + Adresse + Code Postal + Ville + Délai moyen + Produits Action diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 894b519..87ea541 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -78,7 +78,6 @@ export class SupplierTable implements OnInit { try { const suppliers = updateSupplierComponent.supplierForm.getRawValue(); - await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)) this.notificationService.success( diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 7ba9c6c..5593490 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -5,7 +5,7 @@ (ok)="onModalOk()" (cancel)="onModalCancel()"> - +
diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 6de0c4b..0a5051f 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -21,7 +21,7 @@ import {firstValueFrom} from "rxjs"; export class Supplier { modal = viewChild.required('modalButton'); createSupplier = viewChild.required('supplierForm'); - suppliersTable = viewChild.required('suppliersTable'); + supplierTable = viewChild.required('supplierTable'); private usersService = inject(SuppliersService); private notificationService = inject(NzNotificationService) @@ -29,7 +29,7 @@ export class Supplier { await this.addSupplier() this.createSupplier().supplierForm.reset(); this.modal().isVisible = false; - await this.suppliersTable().fetchSuppliers() + await this.supplierTable().fetchSuppliers() } onModalCancel() { diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 72ed5fa..3d6d1ae 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..1e0f210 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec;