From d97484c2f74a5a82f81e038d8bc1273894204d14 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Aug 2024 10:43:24 +0200 Subject: [PATCH] Fix updating instance custom config --- .../edit-custom-config/edit-custom-config.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 65c233398..98ca692a7 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -40,6 +40,7 @@ import { EditHomepageComponent } from './edit-homepage.component' import { EditInstanceInformationComponent } from './edit-instance-information.component' import { EditLiveConfigurationComponent } from './edit-live-configuration.component' import { EditVODTranscodingComponent } from './edit-vod-transcoding.component' +import merge from 'lodash-es/merge' type ComponentCustomConfig = CustomConfig & { instanceCustomHomepage: CustomPage @@ -368,7 +369,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { this.forceCheck() if (!this.form.valid) return - const value: ComponentCustomConfig = this.form.getRawValue() + const value: ComponentCustomConfig = merge(this.customConfig, this.form.getRawValue()) forkJoin([ this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')), @@ -376,9 +377,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { ]) .subscribe({ next: ([ resConfig ]) => { - const instanceCustomHomepage = { - content: value.instanceCustomHomepage.content - } + const instanceCustomHomepage = { content: value.instanceCustomHomepage.content } this.customConfig = { ...resConfig, instanceCustomHomepage }