From 1dc0d40a15056ef1396454d812d95229273c3a4b Mon Sep 17 00:00:00 2001 From: Behzad Rabiei Date: Mon, 11 Nov 2024 15:32:18 +0400 Subject: [PATCH] chore: delete no needed code --- src/controllers/platform.controller.ts | 2 +- src/services/discourse/core.service.ts | 4 ++-- src/services/platform.service.ts | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/controllers/platform.controller.ts b/src/controllers/platform.controller.ts index 9797df7..f7da1bc 100644 --- a/src/controllers/platform.controller.ts +++ b/src/controllers/platform.controller.ts @@ -25,7 +25,7 @@ const logger = parentLogger.child({ module: 'PlatformController' }); const createPlatform = catchAsync(async function (req: IAuthRequest, res: Response) { const community = req.community; const platform = await platformService.managePlatformConnection(community?.id, req.body); - await platformService.callExtractionApp(platform); + platformService.callExtractionApp(platform); res.status(httpStatus.CREATED).send(platform); }); diff --git a/src/services/discourse/core.service.ts b/src/services/discourse/core.service.ts index e48149a..3d9c905 100644 --- a/src/services/discourse/core.service.ts +++ b/src/services/discourse/core.service.ts @@ -24,14 +24,14 @@ async function runDiscourseExtraction(platformId: string): Promise { const data = { platform_id: platformId, }; - console.log(data); + logger.debug(data); const response = await fetch(config.discourse.extractionURL, { method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' }, }); if (response.ok) { - console.log(await response.json()); + logger.debug(await response.json()); return; } else { const errorResponse = await response.text(); diff --git a/src/services/platform.service.ts b/src/services/platform.service.ts index f72ca65..cd2260b 100644 --- a/src/services/platform.service.ts +++ b/src/services/platform.service.ts @@ -27,9 +27,6 @@ const createPlatform = async (PlatformBody: IPlatform): Promise} platform * @returns {Promise} */ -const callExtractionApp = async (platform: HydratedDocument): Promise => { +const callExtractionApp = (platform: HydratedDocument): void => { switch (platform.name) { case PlatformNames.Discourse: { - await discourseService.coreService.runDiscourseExtraction(platform.id as string); + discourseService.coreService.runDiscourseExtraction(platform.id as string); return; } default: {