mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 22:24:11 +00:00
feat: add load rundown api endpoint
This commit is contained in:
@@ -12,7 +12,7 @@ import { DeepPartial } from 'ts-essentials';
|
||||
|
||||
import { socket } from '../adapters/WebsocketAdapter.js';
|
||||
import { getCurrentRundown, getProjectCustomFields } from '../api-data/rundown/rundown.dao.js';
|
||||
import { editEntry } from '../api-data/rundown/rundown.service.js';
|
||||
import { editEntry, loadRundown } from '../api-data/rundown/rundown.service.js';
|
||||
import { willCauseRegeneration } from '../api-data/rundown/rundown.utils.js';
|
||||
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
|
||||
import { auxTimerService } from '../services/aux-timer-service/AuxTimerService.js';
|
||||
@@ -307,6 +307,15 @@ const actionHandlers: Record<ApiActionTag, ActionHandler> = {
|
||||
runtimeService.setOffsetMode(mode);
|
||||
return { payload: 'success' };
|
||||
},
|
||||
rundown: async (payload) => {
|
||||
assert.isObject(payload);
|
||||
if ('load' in payload) {
|
||||
assert.isString(payload.load);
|
||||
await loadRundown(payload.load);
|
||||
return { payload: 'success' };
|
||||
}
|
||||
throw new Error('No matching method provided');
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user