import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
import { CustomConfig } from '../../models/server/custom-config.model'
+import { DeepPartial } from '@server/typings/utils'
+import { merge } from 'lodash'
function getConfig (url: string) {
const path = '/api/v1/config'
})
}
-function updateCustomSubConfig (url: string, token: string, newConfig: any) {
+function updateCustomSubConfig (url: string, token: string, newConfig: DeepPartial<CustomConfig>) {
const updateParams: CustomConfig = {
instance: {
name: 'PeerTube updated',
enabled: true,
manualApproval: false
}
+ },
+ followings: {
+ instance: {
+ autoFollowBack: {
+ enabled: false
+ },
+ autoFollowIndex: {
+ indexUrl: 'https://instances.joinpeertube.org',
+ enabled: false
+ }
+ }
}
}
- Object.assign(updateParams, newConfig)
+ merge(updateParams, newConfig)
return updateCustomConfig(url, token, updateParams)
}