#4338 Warenausgabe - "Bearbeiten" bringt Fehler

This commit is contained in:
Lorenz Hilpert
2023-10-09 13:34:34 +02:00
parent bd3f8af924
commit bd674a0e14
2 changed files with 13 additions and 5 deletions

View File

@@ -173,6 +173,9 @@ export class SharedGoodsInOutOrderEditComponent implements OnChanges, OnDestroy
}
async updateNotificationsGroup() {
if (this.items.length === 0) {
return;
}
const orderId = this.items[0].orderId;
try {

View File

@@ -108,7 +108,10 @@ export class UiSelectComponent extends UiFormControlDirective<any> implements Co
}
writeValue(obj: any): void {
this.setValue(obj, false);
this.setValue(obj, {
emitEvent: false,
touched: false,
});
}
registerOnChange(fn: any): void {
@@ -126,16 +129,18 @@ export class UiSelectComponent extends UiFormControlDirective<any> implements Co
}
}
setValue(value: any, emitEvent: boolean = true) {
setValue(value: any, { emitEvent, touched }: { emitEvent?: boolean; touched?: boolean } = {}) {
if (this.value !== value) {
this.value = value;
if (emitEvent) {
if (emitEvent ?? true) {
this.onChange(this.value);
}
}
this.onTouched();
if (touched ?? true) {
this.onTouched();
}
}
this.cdr.markForCheck();
}