mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
refactor: restructure model to contain an object of rundowns
This commit is contained in:
@@ -169,7 +169,12 @@ async function saveChanges(patch: Partial<AutomationSettings>) {
|
||||
const automation = getDataProvider().getAutomation();
|
||||
|
||||
// remove undefined keys from object, we probably want a better solution
|
||||
Object.keys(patch).forEach((key) => (patch[key] === undefined ? delete patch[key] : {}));
|
||||
Object.keys(patch).forEach((key) => {
|
||||
const typedKey = key as keyof AutomationSettings;
|
||||
if (patch[typedKey] === undefined) {
|
||||
delete patch[typedKey];
|
||||
}
|
||||
});
|
||||
await getDataProvider().setAutomation({ ...automation, ...patch });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user