fixed errors in supplier page
This commit is contained in:
@@ -36,6 +36,15 @@
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
<nz-form-item nz-flex>
|
||||
<nz-form-label nzSpan="9" nzRequired>
|
||||
Code Postal
|
||||
</nz-form-label>
|
||||
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
|
||||
<input nz-input placeholder="Code Postal" formControlName="zipCode">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
<nz-form-item nz-flex>
|
||||
<nz-form-label nzSpan="9" nzRequired>
|
||||
Ville
|
||||
@@ -50,7 +59,7 @@
|
||||
Délai Moyen
|
||||
</nz-form-label>
|
||||
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
|
||||
<input nz-input placeholder="Délai Moyen" formControlName="deliveryDelay">
|
||||
<input nz-input type="number" placeholder="Délai Moyen" formControlName="deliveryDelay">
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
|
||||
|
||||
@@ -27,11 +27,13 @@ export class SupplierForm {
|
||||
email: new FormControl<string>(null, [Validators.required]),
|
||||
phone: new FormControl<string>(null, [Validators.required]),
|
||||
address: new FormControl<string>(null, [Validators.required]),
|
||||
zipCode: new FormControl<string>(null, [Validators.required]),
|
||||
city: new FormControl<string>(null, [Validators.required]),
|
||||
deliveryDelay: new FormControl<string>(null, [Validators.required]),
|
||||
|
||||
})
|
||||
supplier= input.required<GetSupplierDto | null>();
|
||||
|
||||
supplier= input<GetSupplierDto>();
|
||||
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,
|
||||
});
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
<thead>
|
||||
<tr style="text-align: center">
|
||||
<th>Nom</th>
|
||||
<th>Prénom</th>
|
||||
<th>Téléphone</th>
|
||||
<th>Email</th>
|
||||
<th>Anniversaire</th>
|
||||
<th>Emprunt</th>
|
||||
<th>Adresse</th>
|
||||
<th>Code Postal</th>
|
||||
<th>Ville</th>
|
||||
<th>Délai moyen</th>
|
||||
<th>Produits</th>
|
||||
<th style="display: flex; align-items: center;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
(ok)="onModalOk()"
|
||||
(cancel)="onModalCancel()">
|
||||
|
||||
<app-supplier-form #supplierForm [supplier]=""></app-supplier-form>
|
||||
<app-supplier-form #supplierForm></app-supplier-form>
|
||||
</app-modal-button>
|
||||
|
||||
<div class="ml-95 w-150">
|
||||
|
||||
@@ -21,7 +21,7 @@ import {firstValueFrom} from "rxjs";
|
||||
export class Supplier {
|
||||
modal = viewChild.required<ModalButton>('modalButton');
|
||||
createSupplier = viewChild.required<SupplierForm>('supplierForm');
|
||||
suppliersTable = viewChild.required<SupplierTable>('suppliersTable');
|
||||
supplierTable = viewChild.required<SupplierTable>('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() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.gitignore
|
||||
.openapi-generator-ignore
|
||||
README.md
|
||||
api.base.service.ts
|
||||
api.module.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;
|
||||
|
||||
Reference in New Issue
Block a user