mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
Fix: rundown import (#1795)
* fix: patch in the active rundown id and title * fix: send a ALL refetch on project patch * fix: load the last used rundown on project patch and not just the first one * chore: lint * chore: clean up and let rundown service send the refetch request * chore: dont destructure rundown
This commit is contained in:
@@ -31,7 +31,6 @@ export async function patchPartialProjectFile(req: Request, res: Response<Databa
|
||||
};
|
||||
|
||||
const newData = await projectService.patchCurrentProject(patchDb);
|
||||
|
||||
res.status(200).send(newData);
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
|
||||
@@ -323,11 +323,14 @@ export async function patchCurrentProject(data: Partial<DatabaseModel>) {
|
||||
|
||||
/**
|
||||
* The user may have multiple rundowns
|
||||
* We currently ignore all other rundowns
|
||||
* so attempt to get the one that was used last
|
||||
* otherwise just pick the first
|
||||
*/
|
||||
const firstRundown = getFirstRundown(result);
|
||||
const last = await getLastLoaded();
|
||||
const rundownToLoad =
|
||||
last?.rundownId && last.rundownId in result ? result[last.rundownId] : getFirstRundown(result);
|
||||
|
||||
await initRundown(firstRundown, customFields);
|
||||
await initRundown(rundownToLoad, customFields, true);
|
||||
}
|
||||
|
||||
const updatedData = await getDataProvider().getData();
|
||||
|
||||
Reference in New Issue
Block a user