🐛 Fix config changer and critical bug in copy config

This commit is contained in:
Manuel
2023-01-17 21:39:29 +01:00
parent 8b3aa72f1c
commit a003d9430a
5 changed files with 19 additions and 10 deletions

View File

@@ -1,9 +1,13 @@
import Consola from 'consola';
import { ConfigType } from '../../types/config';
import { getConfig } from './getConfig';
export const getFrontendConfig = (name: string): ConfigType => {
const config = getConfig(name);
Consola.info(`Requested frontend content of configuration '${name}'`);
return {
...config,
apps: config.apps.map((app) => ({

View File

@@ -40,6 +40,9 @@ const fetchCopy = async (configName: string, config: ConfigType | undefined) =>
throw new Error('config is not defiend');
}
const copiedConfig = config;
copiedConfig.configProperties.name = configName;
const response = await fetch(`/api/configs/${configName}`, {
method: 'PUT',
headers: {