diff --git a/api-service/package.json b/api-service/package.json index d34a4325..4359e729 100644 --- a/api-service/package.json +++ b/api-service/package.json @@ -30,7 +30,7 @@ "body-parser": "^1.20.2", "compression": "^1.7.4", "dateformat": "2.0.0", - "express": "^4.18.2", + "express": "^5.0.0-beta.3", "http-errors": "^2.0.0", "http-status": "^1.5.3", "kafka-node": "^5.0.0", diff --git a/api-service/src/app.ts b/api-service/src/app.ts index 2dbbd887..66cbaa4d 100644 --- a/api-service/src/app.ts +++ b/api-service/src/app.ts @@ -25,7 +25,6 @@ app.use(bodyParser.json({ limit: config.body_parser_limit})); app.use(express.text()); app.use(express.json()); app.use(errorHandler) -app.use(obsrvErrorHandler); app.set("queryServices", services); loadExtensions(app) @@ -35,7 +34,7 @@ loadExtensions(app) app.use("/", router); app.use("/", metricsRouter); app.use("*", ResponseHandler.routeNotFound); - app.use(ResponseHandler.errorResponse); + app.use(obsrvErrorHandler); app.listen(config.api_port, () => { console.log(`listening on port ${config.api_port}`); diff --git a/api-service/src/v2/controllers/DatasetCreate/DatasetCreate.ts b/api-service/src/v2/controllers/DatasetCreate/DatasetCreate.ts index 6b648305..0906098e 100644 --- a/api-service/src/v2/controllers/DatasetCreate/DatasetCreate.ts +++ b/api-service/src/v2/controllers/DatasetCreate/DatasetCreate.ts @@ -32,7 +32,7 @@ const validateRequest = async (req: Request) => { const datasetCreate = async (req: Request, res: Response) => { - validateRequest(req) + await validateRequest(req) const draftDataset = getDraftDataset(req.body.request) const dataset = await datasetService.createDraftDataset(draftDataset); ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: dataset });