Fix icon save #63
3 changed files with 6 additions and 5 deletions
|
@ -260,7 +260,7 @@
|
|||
@if (auth.loggedIn) {
|
||||
<div class="container w-full lg:ps-64">
|
||||
<div
|
||||
class="object-contain object-scale-down p-4 sm:p-6 space-y-4 sm:space-y-6"
|
||||
class="object-contain p-4 sm:p-6 "
|
||||
>
|
||||
<router-outlet />
|
||||
</div>
|
||||
|
|
|
@ -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