restore rundownGetAll (#1162)

This commit is contained in:
Alex Christoffer Rasmussen
2024-07-29 13:29:56 +02:00
committed by GitHub
parent c7893938eb
commit 67be4a5631
2 changed files with 16 additions and 2 deletions
@@ -1,4 +1,11 @@
import { ErrorResponse, MessageResponse, OntimeRundownEntry, RundownCached, RundownPaginated } from 'ontime-types';
import {
ErrorResponse,
MessageResponse,
OntimeRundown,
OntimeRundownEntry,
RundownCached,
RundownPaginated,
} from 'ontime-types';
import { getErrorMessage } from 'ontime-utils';
import { Request, Response } from 'express';
@@ -22,6 +29,11 @@ import {
getRundown,
} from '../../services/rundown-service/rundownUtils.js';
export async function rundownGetAll(_req: Request, res: Response<OntimeRundown>) {
const rundown = getRundown();
res.json(rundown);
}
export async function rundownGetNormalised(_req: Request, res: Response<RundownCached>) {
const cachedRundown = getNormalisedRundown();
res.json(cachedRundown);
@@ -6,6 +6,7 @@ import {
rundownBatchPut,
rundownDelete,
rundownFrozenPost,
rundownGetAll,
rundownGetById,
rundownGetNormalised,
rundownGetPaginated,
@@ -29,7 +30,8 @@ import { preventIfFrozen } from './rundown.middleware.js';
export const router = express.Router();
router.get('/', rundownGetPaginatedQueryParams, rundownGetPaginated); // not used in Ontime frontend
router.get('/', rundownGetAll); // not used in Ontime frontend
router.get('/paginated', rundownGetPaginatedQueryParams, rundownGetPaginated); // not used in Ontime frontend
router.get('/normalised', rundownGetNormalised);
router.get('/:eventId', paramsMustHaveEventId, rundownGetById); // not used in Ontime frontend