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',
shortDescription: 'my short description',
description: 'my super description',
terms: 'my super terms',
+ codeOfConduct: 'my super coc',
+
+ creationReason: 'my super creation reason',
+ moderationInformation: 'my super moderation information',
+ administrator: 'Kuja',
+ maintenanceLifetime: 'forever',
+ businessModel: 'my super business model',
+
+ languages: [ 'en', 'es' ],
+ categories: [ 1, 2 ],
+
defaultClientRoute: '/videos/recently-added',
isNSFW: true,
defaultNSFWPolicy: 'blur',
css: 'body { background-color: red; }'
}
},
+ theme: {
+ default: 'default'
+ },
services: {
twitter: {
username: '@MySuperUsername',
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)
}