fix: edit charge - tax group is mandatory by backend, but cannot be set on UI
now no empty tax-group request is sent to backend from edit charge Fixes: #1722
This commit is contained in:
committed by
Adam Saghy
parent
6af25660d9
commit
f6f72c25e2
@@ -101,15 +101,15 @@
|
|||||||
|
|
||||||
<mat-form-field fxFlex="48%">
|
<mat-form-field fxFlex="48%">
|
||||||
<mat-label>Tax Group</mat-label>
|
<mat-label>Tax Group</mat-label>
|
||||||
<mat-select *ngIf="chargeData.taxGroup" required formControlName="taxGroupId">
|
<mat-select *ngIf="chargeData.taxGroup" formControlName="taxGroupId">
|
||||||
<mat-option *ngFor="let taxGroup of chargeData.taxGroupOptions" [value]="taxGroup.id">
|
<mat-option *ngFor="let taxGroup of chargeData.taxGroupOptions" [value]="taxGroup.id">
|
||||||
{{ taxGroup.name }}
|
{{ taxGroup.name }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|
||||||
<mat-select *ngIf="!chargeData.taxGroup" required formControlName="taxGroupId">
|
<mat-select *ngIf="!chargeData.taxGroup" formControlName="taxGroupId">
|
||||||
<mat-option value="?">
|
<mat-option *ngFor="let taxGroup of chargeData.taxGroupOptions" [value]="taxGroup.id">
|
||||||
Select Option
|
{{ taxGroup.name }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export class EditChargeComponent implements OnInit {
|
|||||||
if (this.chargeData.taxGroup) {
|
if (this.chargeData.taxGroup) {
|
||||||
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id }, Validators.required));
|
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id }, Validators.required));
|
||||||
} else {
|
} else {
|
||||||
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '' }));
|
delete this.chargeData.taxGroupId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user