From a5c84a82341b13c03c61c327b68156abf3d6d96e Mon Sep 17 00:00:00 2001 From: vikhyat187 Date: Fri, 8 Nov 2024 07:36:43 +0530 Subject: [PATCH] Updated the backend route to /aws/groups/access --- src/utils/awsAccess.ts | 2 +- tests/unit/handlers/grantAwsAccessCommand.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/awsAccess.ts b/src/utils/awsAccess.ts index d37b47ba..cfb4c530 100644 --- a/src/utils/awsAccess.ts +++ b/src/utils/awsAccess.ts @@ -19,7 +19,7 @@ export async function processAWSAccessRequest( ); const discordReplyUrl = `${DISCORD_BASE_URL}/channels/${channelId}/messages`; const base_url = config(env).RDS_BASE_API_URL; - const grantAWSAccessAPIUrl = `${base_url}/aws-access?dev=true`; + const grantAWSAccessAPIUrl = `${base_url}/aws/groups/access?dev=true`; try { const requestData = { diff --git a/tests/unit/handlers/grantAwsAccessCommand.test.ts b/tests/unit/handlers/grantAwsAccessCommand.test.ts index a14fbe1a..66e2ce9f 100644 --- a/tests/unit/handlers/grantAwsAccessCommand.test.ts +++ b/tests/unit/handlers/grantAwsAccessCommand.test.ts @@ -59,7 +59,7 @@ describe("ProcessAWSAccessRequest", () => { const fetchCalls: string[] = []; fetchSpy.mockImplementation((url, options) => { fetchCalls.push(`Fetch call to: ${url}`); - if (url.includes("/aws-access")) { + if (url.includes("/aws/groups/access")) { return Promise.resolve({ ok: true } as Response); } else if (url.includes("/channels/123456789/messages")) { return Promise.resolve({ ok: true } as Response); @@ -77,7 +77,7 @@ describe("ProcessAWSAccessRequest", () => { expect(fetchSpy).toHaveBeenCalledTimes(2); expect(fetchCalls).toHaveLength(2); - expect(fetchCalls[0]).toContain("/aws-access"); + expect(fetchCalls[0]).toContain("/aws/groups/access"); expect(fetchCalls[1]).toContain("/channels/123456789/messages"); }); @@ -85,7 +85,7 @@ describe("ProcessAWSAccessRequest", () => { const fetchCalls: string[] = []; fetchSpy.mockImplementation((url, options) => { fetchCalls.push(`Fetch call to: ${url}`); - if (url.includes("/aws-access")) { + if (url.includes("/aws/groups/access")) { return Promise.resolve({ ok: false, status: 500, @@ -107,7 +107,7 @@ describe("ProcessAWSAccessRequest", () => { expect(fetchSpy).toHaveBeenCalledTimes(2); expect(fetchCalls).toHaveLength(2); - expect(fetchCalls[0]).toContain("/aws-access"); + expect(fetchCalls[0]).toContain("/aws/groups/access"); expect(fetchCalls[1]).toContain("/channels/123456789/messages"); }); });