From fbd0dfbd51d6574bf6ea9329ff3b27aa188ca749 Mon Sep 17 00:00:00 2001 From: yashashk Date: Mon, 13 May 2024 16:16:08 +0530 Subject: [PATCH] Sanketika-obsrv/issue-tracker#157: changed error code name --- .../CreateQueryTemplate/CreateTemplateController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-service/src/controllers/CreateQueryTemplate/CreateTemplateController.ts b/api-service/src/controllers/CreateQueryTemplate/CreateTemplateController.ts index e4b97f3e..64a7ce7e 100644 --- a/api-service/src/controllers/CreateQueryTemplate/CreateTemplateController.ts +++ b/api-service/src/controllers/CreateQueryTemplate/CreateTemplateController.ts @@ -37,8 +37,8 @@ export const createQueryTemplate = async (req: Request, res: Response) => { const { validTemplate } = await validateTemplate(requestBody); if (!validTemplate) { - logger.error({ apiId, msgid, resmsgid, requestBody: req?.body, message: `Invalid template provided, A template should consist of variables ${requiredVariables} and type of json,sql`, code: "QUERY_TEMPLATE_INVALID" }) - return ResponseHandler.errorResponse({ statusCode: 400, message: `Invalid template provided, A template should consist of variables ${requiredVariables} and type of json,sql`, errCode: "BAD_REQUEST", code: "QUERY_TEMPLATE_INVALID" }, req, res) + logger.error({ apiId, msgid, resmsgid, requestBody: req?.body, message: `Invalid template provided, A template should consist of variables ${requiredVariables} and type of json,sql`, code: "QUERY_TEMPLATE_INVALID_INPUT" }) + return ResponseHandler.errorResponse({ statusCode: 400, message: `Invalid template provided, A template should consist of variables ${requiredVariables} and type of json,sql`, errCode: "BAD_REQUEST", code: "QUERY_TEMPLATE_INVALID_INPUT" }, req, res) } const data = transformRequest(requestBody, templateName);