From 2bc33d0c956a99199aea40fcda24e026702ca8ba Mon Sep 17 00:00:00 2001 From: vikhyat187 Date: Tue, 29 Oct 2024 21:39:31 +0530 Subject: [PATCH] Fixing test case - changing the return type to Promise --- src/utils/awsAccess.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/awsAccess.ts b/src/utils/awsAccess.ts index 503207c4..797b57d9 100644 --- a/src/utils/awsAccess.ts +++ b/src/utils/awsAccess.ts @@ -9,7 +9,7 @@ export async function processAWSAccessRequest( awsGroupId: string, env: env, channelId: number -) { +) : Promise { const authToken = await jwt.sign( { name: "Cloudflare Worker", exp: Math.floor(Date.now() / 1000) + 2 }, env.BOT_PRIVATE_KEY, @@ -42,7 +42,7 @@ export async function processAWSAccessRequest( } else { content = `AWS access granted successfully <@${discordUserId}>! Please head over to AWS - ${AWS_IAM_SIGNIN_URL}.`; } - return fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, { + await fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, { method: "POST", headers: { "Content-Type": "application/json", @@ -54,7 +54,7 @@ export async function processAWSAccessRequest( }); } catch (err) { const content = `<@${discordUserId}> Error occurred while granting AWS access.`; - return fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, { + await fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, { method: "POST", headers: { "Content-Type": "application/json",