feat(server, web): accepted codecs (#6460)

* chore: rebase

* chore: open api

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Markus 2024-01-26 18:02:56 +01:00 committed by GitHub
parent 96b7885583
commit 8aef92affc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 181 additions and 10 deletions

View file

@ -9,6 +9,7 @@
import { handleError } from '$lib/utils/handle-error';
import type { SettingsEventType } from './admin-settings';
import { createEventDispatcher, onMount } from 'svelte';
import { cloneDeep } from 'lodash-es';
export let config: SystemConfigDto;
@ -25,16 +26,17 @@
}
};
const handleSave = async (config: Partial<SystemConfigDto>) => {
const handleSave = async (update: Partial<SystemConfigDto>) => {
try {
const result = await api.systemConfigApi.updateConfig({
const { data: newConfig } = await api.systemConfigApi.updateConfig({
systemConfigDto: {
...savedConfig,
...config,
...update,
},
});
savedConfig = { ...result.data };
config = cloneDeep(newConfig);
savedConfig = cloneDeep(newConfig);
notificationController.show({ message: 'Settings saved', type: NotificationType.Info });
dispatch('save');