From 993140480e77bd618141cde8b6454477a299d42b Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 5 Feb 2024 23:01:08 +0530 Subject: [PATCH] fix the await clause --- src/controllers/trackingPlan.ts | 2 +- src/services/trackingPlan.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/trackingPlan.ts b/src/controllers/trackingPlan.ts index f96be6a5f7..e4802cfc4d 100644 --- a/src/controllers/trackingPlan.ts +++ b/src/controllers/trackingPlan.ts @@ -7,7 +7,7 @@ export class TrackingPlanController { const events = ctx.request.body; const requestSize = Number(ctx.request.get('content-length')); const reqParams = ctx.request.query; - const response = TrackingPlanservice.validate(events, requestSize, reqParams); + const response = await TrackingPlanservice.validate(events, requestSize, reqParams); ctx.body = response.body; ControllerUtility.postProcess(ctx, response.status); return ctx; diff --git a/src/services/trackingPlan.ts b/src/services/trackingPlan.ts index 89544cd9c8..64bb65a0f7 100644 --- a/src/services/trackingPlan.ts +++ b/src/services/trackingPlan.ts @@ -13,8 +13,8 @@ export class TrackingPlanservice { const metaTags = events.length && events[0].metadata ? getMetadata(events[0].metadata) : {}; let ctxStatusCode = 200; - for(let event of events) { - let toAdd; + for (let event of events) { + let toAdd: any; let exceptionOccured = false; try {