Fix icon metadata
This commit is contained in:
parent
8ea82bf7d4
commit
ffef985690
2 changed files with 5 additions and 4 deletions
|
@ -54,7 +54,6 @@ export class TalkgroupRecordComponent {
|
|||
weight: new FormControl(this.tg.weight),
|
||||
icon: new FormControl(this.tg.icon),
|
||||
});
|
||||
console.log(this.tg.icon);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -83,14 +82,15 @@ export class TalkgroupRecordComponent {
|
|||
tgu.weight = Number(this.form.controls['weight'].value);
|
||||
}
|
||||
if (this.form.controls['icon'].dirty) {
|
||||
let iv: string = this.form.controls['icon'].value;
|
||||
if (tgu.metadata == null) {
|
||||
tgu.metadata = {};
|
||||
}
|
||||
if (this.tg.icon == null || this.tg.icon == '') {
|
||||
if (iv == '') {
|
||||
tgu.metadata = Object.assign(tgu.metadata, { icon: undefined });
|
||||
} else {
|
||||
tgu.metadata = Object.assign(tgu.metadata!, {
|
||||
icon: this.form.controls['icon'],
|
||||
icon: iv,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<div class="w-100 justify-center overflow-x-auto">
|
||||
<a href="#" class="btn btn-primary" routerLink="/talkgroups/import">Import</a>
|
||||
<div class="rounded-lg border border-gray-200 dark:border-gray-700">
|
||||
<div class="overflow-x-auto rounded-t-lg">
|
||||
<table
|
||||
|
@ -177,3 +176,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="#" class="btn btn-primary" routerLink="/talkgroups/import">Import</a>
|
Loading…
Reference in a new issue