Skip to content

Commit 2bc33d0

Browse files
committed
Fixing test case - changing the return type to Promise<void>
1 parent fddc63a commit 2bc33d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/awsAccess.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function processAWSAccessRequest(
99
awsGroupId: string,
1010
env: env,
1111
channelId: number
12-
) {
12+
) : Promise<void> {
1313
const authToken = await jwt.sign(
1414
{ name: "Cloudflare Worker", exp: Math.floor(Date.now() / 1000) + 2 },
1515
env.BOT_PRIVATE_KEY,
@@ -42,7 +42,7 @@ export async function processAWSAccessRequest(
4242
} else {
4343
content = `AWS access granted successfully <@${discordUserId}>! Please head over to AWS - ${AWS_IAM_SIGNIN_URL}.`;
4444
}
45-
return fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, {
45+
await fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, {
4646
method: "POST",
4747
headers: {
4848
"Content-Type": "application/json",
@@ -54,7 +54,7 @@ export async function processAWSAccessRequest(
5454
});
5555
} catch (err) {
5656
const content = `<@${discordUserId}> Error occurred while granting AWS access.`;
57-
return fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, {
57+
await fetch(`${DISCORD_BASE_URL}/channels/${channelId}/messages`, {
5858
method: "POST",
5959
headers: {
6060
"Content-Type": "application/json",

0 commit comments

Comments
 (0)