From 57fa195da5022b31c430ab1469682e84340417f3 Mon Sep 17 00:00:00 2001 From: ashish-egov <137176738+ashish-egov@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:38:40 +0530 Subject: [PATCH] Update campaignUtils.ts (#974) --- utilities/project-factory/src/server/utils/campaignUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/project-factory/src/server/utils/campaignUtils.ts b/utilities/project-factory/src/server/utils/campaignUtils.ts index ceb0f3769fc..25c69502cc6 100644 --- a/utilities/project-factory/src/server/utils/campaignUtils.ts +++ b/utilities/project-factory/src/server/utils/campaignUtils.ts @@ -479,12 +479,12 @@ async function generateProcessedFileAndPersist(request: any, localizationMap?: { } produceModifiedMessages(persistMessage, config?.kafka?.KAFKA_UPDATE_RESOURCE_DETAILS_TOPIC); logger.info(`ResourceDetails to persist : ${request.body.ResourceDetails.type}`); - if (request?.body?.Activities && Array.isArray(request?.body?.Activities && request?.body?.Activities.length > 0)) { + if (request?.body?.Activities && Array.isArray(request?.body?.Activities) && request?.body?.Activities.length > 0) { logger.info("Activities to persist : ") logger.debug(getFormattedStringForDebug(request?.body?.Activities)); logger.info(`Waiting for 2 seconds`); await new Promise(resolve => setTimeout(resolve, 2000)); - produceModifiedMessages(request?.body, config?.kafka?.KAFKA_CREATE_RESOURCE_ACTIVITY_TOPIC); + produceModifiedMessages(request?.body, config.kafka.KAFKA_CREATE_RESOURCE_ACTIVITY_TOPIC); } }