mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
committed by
Rainer Killinger
parent
f11376ecf8
commit
12b71ba1f1
@@ -36,7 +36,7 @@ export const bulkAddRouter = createRoute<SCBulkAddResponse>(
|
||||
|
||||
if (typeof bulk === 'undefined') {
|
||||
logger.warn(`Bulk with ${params.UID} not found.`);
|
||||
throw new SCNotFoundErrorResponse(app.get('isProductiveEnvironment'));
|
||||
throw new SCNotFoundErrorResponse(app.get('isTestEnvironment'));
|
||||
}
|
||||
|
||||
await bulkMemory.database.post(request, bulk);
|
||||
|
||||
@@ -36,7 +36,7 @@ export const bulkDoneRouter = createRoute<SCBulkDoneResponse>(
|
||||
|
||||
if (typeof bulk === 'undefined') {
|
||||
logger.warn(`Bulk with ${params.UID} not found.`);
|
||||
throw new SCNotFoundErrorResponse(app.get('isProductiveEnvironment'));
|
||||
throw new SCNotFoundErrorResponse(app.get('isTestEnvironment'));
|
||||
}
|
||||
|
||||
bulk.state = 'done';
|
||||
|
||||
@@ -80,7 +80,7 @@ export function createRoute<RETURNTYPE>(
|
||||
if (requestValidation.errors.length > 0) {
|
||||
const error = new SCValidationErrorResponse(
|
||||
requestValidation.errors,
|
||||
req.app.get('isProductiveEnvironment'),
|
||||
req.app.get('isTestEnvironment'),
|
||||
);
|
||||
res.status(error.statusCode);
|
||||
res.json(error);
|
||||
@@ -101,7 +101,7 @@ export function createRoute<RETURNTYPE>(
|
||||
);
|
||||
const internalServerError = new SCInternalServerErrorResponse(
|
||||
validationError,
|
||||
req.app.get('isProductiveEnvironment'),
|
||||
req.app.get('isTestEnvironment'),
|
||||
);
|
||||
res.status(internalServerError.statusCode);
|
||||
res.json(internalServerError);
|
||||
@@ -125,7 +125,7 @@ export function createRoute<RETURNTYPE>(
|
||||
// the error is not allowed so something went wrong
|
||||
const internalServerError = new SCInternalServerErrorResponse(
|
||||
error,
|
||||
req.app.get('isProductiveEnvironment'),
|
||||
req.app.get('isTestEnvironment'),
|
||||
);
|
||||
res.status(internalServerError.statusCode);
|
||||
res.json(internalServerError);
|
||||
@@ -139,7 +139,7 @@ export function createRoute<RETURNTYPE>(
|
||||
|
||||
// return a SCMethodNotAllowedErrorResponse on all other HTTP methods
|
||||
route.all((req, res) => {
|
||||
const error = new SCMethodNotAllowedErrorResponse(req.app.get('isProductiveEnvironment'));
|
||||
const error = new SCMethodNotAllowedErrorResponse(req.app.get('isTestEnvironment'));
|
||||
res.status(error.statusCode);
|
||||
res.json(error);
|
||||
logger.warn(error);
|
||||
|
||||
Reference in New Issue
Block a user