Upgrade expressjs (#1633)

* upgrade expressjs

* migration

* reenable test

* extend timeout on download test

* fixup! migration

* move empty body test from controller to validator

* enusre not empty

* extract validation function

* fixup! reenable test

* remove thin controllers

* disable e2e test of project file download
This commit is contained in:
Alex Christoffer Rasmussen
2025-06-12 15:02:35 +02:00
committed by Carlos Valente
parent 90870ecfb6
commit 6f3ab274bd
39 changed files with 590 additions and 841 deletions
@@ -19,7 +19,6 @@ import {
ungroupEntries,
} from './rundown.service.js';
import {
paramsMustHaveEntryId,
rundownArrayOfIds,
rundownBatchPutValidator,
rundownPostValidator,
@@ -27,6 +26,7 @@ import {
rundownReorderValidator,
rundownSwapValidator,
} from './rundown.validation.js';
import { paramsWithId } from '../validation-utils/validationFunction.js';
export const router = express.Router();
@@ -100,11 +100,11 @@ router.patch('/swap', rundownSwapValidator, async (req: Request, res: Response<R
});
router.patch(
'/applydelay/:entryId',
paramsMustHaveEntryId,
'/applydelay/:id',
paramsWithId,
async (req: Request, res: Response<Rundown | ErrorResponse>) => {
try {
const newRundown = await applyDelay(req.params.entryId);
const newRundown = await applyDelay(req.params.id);
res.status(200).send(newRundown);
} catch (error) {
const message = getErrorMessage(error);
@@ -113,9 +113,9 @@ router.patch(
},
);
router.post('/clone/:entryId', paramsMustHaveEntryId, async (req: Request, res: Response<Rundown | ErrorResponse>) => {
router.post('/clone/:id', paramsWithId, async (req: Request, res: Response<Rundown | ErrorResponse>) => {
try {
const newRundown = await cloneEntry(req.params.entryId);
const newRundown = await cloneEntry(req.params.id);
res.status(200).send(newRundown);
} catch (error) {
const message = getErrorMessage(error);
@@ -134,11 +134,11 @@ router.post('/group', rundownArrayOfIds, async (req: Request, res: Response<Rund
});
router.post(
'/ungroup/:entryId',
paramsMustHaveEntryId,
'/ungroup/:id',
paramsWithId,
async (req: Request, res: Response<Rundown | ErrorResponse>) => {
try {
const newRundown = await ungroupEntries(req.params.entryId);
const newRundown = await ungroupEntries(req.params.id);
res.status(200).send(newRundown);
} catch (error) {
const message = getErrorMessage(error);