feat(config): make data structure horizontal

This commit is contained in:
Ali BARIN
2024-09-20 10:43:06 +00:00
parent f4a1ad6c8c
commit 8a17c5eaab
9 changed files with 183 additions and 154 deletions

View File

@@ -3,19 +3,17 @@ import { renderObject } from '../../../../../helpers/renderer.js';
import Config from '../../../../../models/config.js';
export default async (request, response) => {
const config = configParams(request);
const updatedConfig = await Config.update(configParams(request));
await Config.batchUpdate(config);
renderObject(response, config);
renderObject(response, updatedConfig);
};
const configParams = (request) => {
const updatableConfigurationKeys = [
'logo.svgData',
'palette.primary.dark',
'palette.primary.light',
'palette.primary.main',
'logoSvgData',
'palettePrimaryDark',
'palettePrimaryLight',
'palettePrimaryMain',
'title',
];