From 67be4a563137193378219816dfae9780e6fc12d4 Mon Sep 17 00:00:00 2001 From: Alex Christoffer Rasmussen Date: Mon, 29 Jul 2024 13:29:56 +0200 Subject: [PATCH] restore rundownGetAll (#1162) --- .../src/api-data/rundown/rundown.controller.ts | 14 +++++++++++++- apps/server/src/api-data/rundown/rundown.router.ts | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/server/src/api-data/rundown/rundown.controller.ts b/apps/server/src/api-data/rundown/rundown.controller.ts index 157d695c5..d5c77d4cb 100644 --- a/apps/server/src/api-data/rundown/rundown.controller.ts +++ b/apps/server/src/api-data/rundown/rundown.controller.ts @@ -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) { + const rundown = getRundown(); + res.json(rundown); +} + export async function rundownGetNormalised(_req: Request, res: Response) { const cachedRundown = getNormalisedRundown(); res.json(cachedRundown); diff --git a/apps/server/src/api-data/rundown/rundown.router.ts b/apps/server/src/api-data/rundown/rundown.router.ts index 5142b0c13..5cefd66d6 100644 --- a/apps/server/src/api-data/rundown/rundown.router.ts +++ b/apps/server/src/api-data/rundown/rundown.router.ts @@ -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