mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
51c31adaf1
* use zustand store in `ContextMenuContext` * add `withDivider` prop to context menu `Option` * add `isDisabled` prop to `Option` * create `eventIdSwapping` store * create swapping context menu options * fix `key` in ContextMenu * address `tanstack-eslint` errors * create initial `requestEventSwap` event * create initial `swapEvents` action * use `swapEvents` in `EventBlock` * move from `emitError` to `logAxiosError` * remove extra curly brace from Copy ID * add `clearEventId` func * finalize context menu swapping logic * write optimistic swapping logic * remove unused import and type out handler in `rundownController` * create `rundownSwapValidator` * move index increase to `EventBlock` * move swapping logic from `id` to `index` * create `swapEvents` endpoint * move `useEventIdSwapping` hook into its own file * revert to using event `id` * logic now uses indexes to swap events * add `todo` to `swapEvents` * revert index increment * create `swapOntimeEvents` and export in `index.ts` * use `swapOntimeEvents` in frontend & server * update import path * remove extra `setCached`
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import express from 'express';
|
|
import {
|
|
deleteEventById,
|
|
rundownApplyDelay,
|
|
rundownDelete,
|
|
rundownGetAll,
|
|
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/' 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);
|