Skip to content

Commit

Permalink
chore: delete no needed code
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Nov 11, 2024
1 parent 42bac26 commit 1dc0d40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/controllers/platform.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
4 changes: 2 additions & 2 deletions src/services/discourse/core.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ async function runDiscourseExtraction(platformId: string): Promise<void> {
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();
Expand Down
7 changes: 2 additions & 5 deletions src/services/platform.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const createPlatform = async (PlatformBody: IPlatform): Promise<HydratedDocument
if (PlatformBody.name === PlatformNames.Discord) {
await sagaService.createAndStartFetchMemberSaga(platform._id);
}
// if (PlatformBody.name === PlatformNames.Discourse) {
// await discourseService.coreService.createDiscourseForum(platform.metadata?.id);
// }
return platform;
};

Expand Down Expand Up @@ -68,10 +65,10 @@ const getPlatformById = async (id: Types.ObjectId): Promise<HydratedDocument<IPl
* @param {HydratedDocument<IPlatform>} platform
* @returns {Promise<Void>}
*/
const callExtractionApp = async (platform: HydratedDocument<IPlatform>): Promise<void> => {
const callExtractionApp = (platform: HydratedDocument<IPlatform>): void => {
switch (platform.name) {
case PlatformNames.Discourse: {
await discourseService.coreService.runDiscourseExtraction(platform.id as string);
discourseService.coreService.runDiscourseExtraction(platform.id as string);
return;
}
default: {
Expand Down

0 comments on commit 1dc0d40

Please sign in to comment.