mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
884ab0b67b
* refactor: add revision number to rundown * chore: migrate query
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import express from 'express';
|
|
import {
|
|
deleteEventById,
|
|
rundownApplyDelay,
|
|
rundownDelete,
|
|
rundownGetAll,
|
|
rundownGetCached,
|
|
rundownPost,
|
|
rundownPut,
|
|
rundownReorder,
|
|
rundownSwap,
|
|
} from '../controllers/rundownController.js';
|
|
import {
|
|
paramsMustHaveEventId,
|
|
rundownPostValidator,
|
|
rundownPutValidator,
|
|
rundownReorderValidator,
|
|
rundownSwapValidator,
|
|
} from '../controllers/rundownController.validate.js';
|
|
|
|
export const router = express.Router();
|
|
|
|
// create route between controller and '/events/cached' endpoint
|
|
router.get('/cached', rundownGetCached);
|
|
|
|
// create route between controller and '/events/' endpoint
|
|
router.get('/', rundownGetAll);
|
|
|
|
// create route between controller and '/events/' endpoint
|
|
router.post('/', rundownPostValidator, rundownPost);
|
|
|
|
// create route between controller and '/events/' endpoint
|
|
router.put('/', rundownPutValidator, rundownPut);
|
|
|
|
// create route between controller and '/events/reorder' endpoint
|
|
router.patch('/reorder/', rundownReorderValidator, rundownReorder);
|
|
|
|
router.patch('/swap', rundownSwapValidator, rundownSwap);
|
|
|
|
// create route between controller and '/events/applydelay/:eventId' endpoint
|
|
router.patch('/applydelay/:eventId', paramsMustHaveEventId, rundownApplyDelay);
|
|
|
|
// create route between controller and '/events/all' endpoint
|
|
router.delete('/all', rundownDelete);
|
|
|
|
// create route between controller and '/events/:eventId' endpoint
|
|
router.delete('/:eventId', paramsMustHaveEventId, deleteEventById);
|