From 749efdd17f9b37ef1d9c65c0496787c150186ebe Mon Sep 17 00:00:00 2001 From: Gorakh Raj Joshi <59221046+gorakhjoshi@users.noreply.github.com> Date: Sat, 31 Aug 2024 19:37:45 +0545 Subject: [PATCH 1/2] fix: unnecessary async function --- src/routes/access/signup.ts | 2 +- src/routes/access/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/access/signup.ts b/src/routes/access/signup.ts index a863ecf..9652277 100644 --- a/src/routes/access/signup.ts +++ b/src/routes/access/signup.ts @@ -43,7 +43,7 @@ router.post( keystore.primaryKey, keystore.secondaryKey, ); - const userData = await getUserData(createdUser); + const userData = getUserData(createdUser); new SuccessResponse('Signup Successful', { user: userData, diff --git a/src/routes/access/utils.ts b/src/routes/access/utils.ts index c65539f..73fc357 100644 --- a/src/routes/access/utils.ts +++ b/src/routes/access/utils.ts @@ -6,7 +6,7 @@ export const enum AccessMode { SIGNUP = 'SIGNUP', } -export async function getUserData(user: User) { +export function getUserData(user: User) { const data = _.pick(user, ['_id', 'name', 'roles', 'profilePicUrl']); return data; } From c5499d381f9efc15d1a5a56ec94058529320ace1 Mon Sep 17 00:00:00 2001 From: Gorakh Raj Joshi <59221046+gorakhjoshi@users.noreply.github.com> Date: Sat, 31 Aug 2024 20:12:59 +0545 Subject: [PATCH 2/2] fix: remove await for non async function --- src/routes/access/login.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/access/login.ts b/src/routes/access/login.ts index e033c69..408efa3 100755 --- a/src/routes/access/login.ts +++ b/src/routes/access/login.ts @@ -30,7 +30,7 @@ router.post( await KeystoreRepo.create(user, accessTokenKey, refreshTokenKey); const tokens = await createTokens(user, accessTokenKey, refreshTokenKey); - const userData = await getUserData(user); + const userData = getUserData(user); new SuccessResponse('Login Success', { user: userData,