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
-39
View File
@@ -1,39 +0,0 @@
import type { Response } from 'express';
import { isEmptyObject } from './parserUtils.js';
/**
* @description initial checks for an empty of malformed request object
* @param obj
* @param res
*/
export const failEmptyObjects = (obj: object, res: Response): boolean => {
try {
if (isEmptyObject(obj)) {
res.status(400).send('No object found in request');
return true;
}
} catch (error) {
res.status(400).send(error);
return true;
}
return false;
};
/**
* @description initial checks for an empty of malformed request object
* @param obj
* @param res
*/
export const failIsNotArray = (obj: object, res: Response): boolean => {
try {
if (!Array.isArray(obj)) {
res.status(400).send('No array found in request');
return true;
}
} catch (error) {
res.status(400).send(error);
return true;
}
return false;
};