Skip to content

Commit

Permalink
Updated the backend route to /aws/groups/access
Browse files Browse the repository at this point in the history
  • Loading branch information
vikhyat187 committed Nov 8, 2024
1 parent 865d751 commit a5c84a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/utils/awsAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/handlers/grantAwsAccessCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -77,15 +77,15 @@ 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");
});

it("should handle API error", async () => {
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,
Expand All @@ -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");
});
});

0 comments on commit a5c84a8

Please sign in to comment.