mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
refactor: patch does not load rundown
This commit is contained in:
committed by
Carlos Valente
parent
426d42ab63
commit
b70ef80320
@@ -338,21 +338,11 @@ export async function patchCurrentProject(data: Partial<DatabaseModel>) {
|
||||
await getDataProvider().mergeIntoData({ customFields: parsedCustomFields });
|
||||
}
|
||||
|
||||
// then we can checked the rundown
|
||||
// then we can check the rundown
|
||||
if (rundowns) {
|
||||
const parsedCustomFields = await getDataProvider().getCustomFields();
|
||||
const result = parseRundowns(data, parsedCustomFields);
|
||||
|
||||
/**
|
||||
* The user may have multiple rundowns
|
||||
* so attempt to get the one that was used last
|
||||
* otherwise just pick the first
|
||||
*/
|
||||
const last = await getLastLoaded();
|
||||
const rundownToLoad =
|
||||
last?.rundownId && last.rundownId in result ? result[last.rundownId] : getFirstRundown(result);
|
||||
|
||||
await initRundown(rundownToLoad, parsedCustomFields, true); //mergeIntoData is handled by the init function
|
||||
const parsedRundowns = parseRundowns(data, parsedCustomFields);
|
||||
await getDataProvider().mergeIntoData({ rundowns: parsedRundowns });
|
||||
}
|
||||
|
||||
const updatedData = await getDataProvider().getData();
|
||||
|
||||
Reference in New Issue
Block a user