updated supplier page

This commit is contained in:
2025-11-27 19:25:08 +01:00
parent b55bdedc20
commit 376f217456
10 changed files with 117 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
import {Component, input} from '@angular/core';
import {Component, effect, input} from '@angular/core';
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
@@ -31,6 +31,19 @@ export class SupplierForm {
deliveryDelay: new FormControl<string>(null, [Validators.required]),
})
supplier= input.required<GetSupplierDto>()
supplier= input.required<GetSupplierDto | null>();
constructor() {
effect(() => {
if (this.supplier()) {
this.supplierForm.patchValue({
name: this.supplier().name,
email: this.supplier().email,
phone: this.supplier().phone,
address: this.supplier().address,
city: this.supplier().city,
deliveryDelay: this.supplier().deliveryDelay,
});
}
});
}
}