Fix updating instance custom config
This commit is contained in:
parent
16d9204ea8
commit
d97484c2f7
1 changed files with 3 additions and 4 deletions
|
@ -40,6 +40,7 @@ import { EditHomepageComponent } from './edit-homepage.component'
|
||||||
import { EditInstanceInformationComponent } from './edit-instance-information.component'
|
import { EditInstanceInformationComponent } from './edit-instance-information.component'
|
||||||
import { EditLiveConfigurationComponent } from './edit-live-configuration.component'
|
import { EditLiveConfigurationComponent } from './edit-live-configuration.component'
|
||||||
import { EditVODTranscodingComponent } from './edit-vod-transcoding.component'
|
import { EditVODTranscodingComponent } from './edit-vod-transcoding.component'
|
||||||
|
import merge from 'lodash-es/merge'
|
||||||
|
|
||||||
type ComponentCustomConfig = CustomConfig & {
|
type ComponentCustomConfig = CustomConfig & {
|
||||||
instanceCustomHomepage: CustomPage
|
instanceCustomHomepage: CustomPage
|
||||||
|
@ -368,7 +369,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
this.forceCheck()
|
this.forceCheck()
|
||||||
if (!this.form.valid) return
|
if (!this.form.valid) return
|
||||||
|
|
||||||
const value: ComponentCustomConfig = this.form.getRawValue()
|
const value: ComponentCustomConfig = merge(this.customConfig, this.form.getRawValue())
|
||||||
|
|
||||||
forkJoin([
|
forkJoin([
|
||||||
this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')),
|
this.configService.updateCustomConfig(omit(value, 'instanceCustomHomepage')),
|
||||||
|
@ -376,9 +377,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
])
|
])
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: ([ resConfig ]) => {
|
next: ([ resConfig ]) => {
|
||||||
const instanceCustomHomepage = {
|
const instanceCustomHomepage = { content: value.instanceCustomHomepage.content }
|
||||||
content: value.instanceCustomHomepage.content
|
|
||||||
}
|
|
||||||
|
|
||||||
this.customConfig = { ...resConfig, instanceCustomHomepage }
|
this.customConfig = { ...resConfig, instanceCustomHomepage }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue