mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 01:43:43 +00:00
feat: allow dissolving a block
This commit is contained in:
committed by
Carlos Valente
parent
7a6ecd8c34
commit
5cefad3666
@@ -11,6 +11,7 @@ import {
|
||||
deleteAllEntries,
|
||||
deleteEvent,
|
||||
editEvent,
|
||||
dissolveBlock,
|
||||
reorderEntry,
|
||||
swapEvents,
|
||||
} from '../../services/rundown-service/RundownService.js';
|
||||
@@ -126,6 +127,16 @@ export async function rundownApplyDelay(req: Request, res: Response<MessageRespo
|
||||
}
|
||||
}
|
||||
|
||||
export async function rundownDissolveBlock(req: Request, res: Response<Rundown | ErrorResponse>) {
|
||||
try {
|
||||
const newRundown = await dissolveBlock(req.params.eventId);
|
||||
res.status(200).send(newRundown);
|
||||
} catch (error) {
|
||||
const message = getErrorMessage(error);
|
||||
res.status(400).send({ message });
|
||||
}
|
||||
}
|
||||
|
||||
export async function rundownDelete(_req: Request, res: Response<MessageResponse | ErrorResponse>) {
|
||||
try {
|
||||
await deleteAllEntries();
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
rundownApplyDelay,
|
||||
rundownBatchPut,
|
||||
rundownDelete,
|
||||
rundownDissolveBlock,
|
||||
rundownGetAll,
|
||||
rundownGetById,
|
||||
rundownGetCurrent,
|
||||
@@ -37,6 +38,7 @@ router.put('/batch', rundownBatchPutValidator, rundownBatchPut);
|
||||
router.patch('/reorder/', rundownReorderValidator, rundownReorder);
|
||||
router.patch('/swap', rundownSwapValidator, rundownSwap);
|
||||
router.patch('/applydelay/:eventId', paramsMustHaveEventId, rundownApplyDelay);
|
||||
router.post('/dissolve/:eventId', paramsMustHaveEventId, rundownDissolveBlock);
|
||||
|
||||
router.delete('/', rundownArrayOfIds, deletesEventById);
|
||||
router.delete('/all', rundownDelete);
|
||||
|
||||
Reference in New Issue
Block a user