Incepere creare procese separate

This commit is contained in:
andrei-mihnea-cerbu
2024-04-03 23:22:38 +03:00
parent 038b809dd8
commit ffeebf1177
58 changed files with 913 additions and 479 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
const { sendResponse } = require('../helpers/responseHelper');
const {httpStatus, httpStatusMessages} = require("../helpers/httpResponses");
const {httpStatus} = require("../helpers/httpResponses");
function checkJson(req, res, next) {
if(req.method === 'GET'){
@@ -7,7 +7,7 @@ function checkJson(req, res, next) {
}
if (['POST', 'PUT', 'PATCH'].includes(req.method) && req.headers['content-type'] !== 'application/json') {
return sendResponse(res, httpStatus.BAD_REQUEST, httpStatusMessages[httpStatus.BAD_REQUEST]);
return res.status(httpStatus.BAD_REQUEST).json({message: "Body missing in action."});
}
next();