From 9843d8a364eef66198941c11dbc759ecf02be352 Mon Sep 17 00:00:00 2001 From: Behzad-rabiei Date: Tue, 8 Apr 2025 09:45:47 +0200 Subject: [PATCH] debug: check the flow --- src/controllers/platform.controller.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/controllers/platform.controller.ts b/src/controllers/platform.controller.ts index 77aa235..a7a3df0 100644 --- a/src/controllers/platform.controller.ts +++ b/src/controllers/platform.controller.ts @@ -6,19 +6,14 @@ import { DatabaseManager, PlatformNames } from '@togethercrew.dev/db'; import config from '../config'; import parentLogger from '../config/logger'; -import { discord, generateCodeChallenge, generateCodeVerifier, generateState, google, twitter } from '../config/oAtuh2'; +import { + discord, generateCodeChallenge, generateCodeVerifier, generateState, google, twitter +} from '../config/oAtuh2'; import { IAuthAndPlatform, ISessionRequest } from '../interfaces'; import { IAuthRequest } from '../interfaces/Request.interface'; import { - discordServices, - discourseService, - githubService, - googleService, - notionService, - platformService, - tokenService, - twitterService, - userService, + discordServices, discourseService, githubService, googleService, notionService, platformService, + tokenService, twitterService, userService } from '../services'; import { catchAsync, pick } from '../utils'; @@ -323,7 +318,10 @@ const getPlatform = catchAsync(async function (req: IAuthRequest, res: Response) res.send(platform); }); const updatePlatform = catchAsync(async function (req: IAuthAndPlatform, res: Response) { + console.log('Debug1'); platformService.validatePlatformUpdate(req.platform, req.body); + console.log('Debug2'); + const platform = await platformService.updatePlatform(req.platform, req.user, req.body); res.send(platform); });