Skip to content

Commit

Permalink
fix: change api name to /roles/:roleId
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajjs committed Nov 8, 2024
1 parent 5cc429d commit f2cabae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ router.get("/", async () => {

router.patch("/guild/member", changeNickname);

router.delete("/guildroles/:roleId", deleteGuildRoleHandler);
router.delete("/roles/:roleId", deleteGuildRoleHandler);

router.put("/roles/create", createGuildRoleHandler);

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/handlers/deleteGuildRoleHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("deleteGuildRoleHandler", () => {
const roleId = "1A32BEX04";
it("should return NOT_FOUND when dev is false", async () => {
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
params: {
roleId: roleId,
},
Expand All @@ -29,7 +29,7 @@ describe("deleteGuildRoleHandler", () => {
});
it("should return BAD_REQUEST when roleId is not valid", async () => {
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
params: {
roleId: "",
},
Expand All @@ -45,7 +45,7 @@ describe("deleteGuildRoleHandler", () => {
});
it("should return BAD_SIGNATURE when authorization header is not provided", async () => {
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
params: {
roleId: roleId,
},
Expand All @@ -61,7 +61,7 @@ describe("deleteGuildRoleHandler", () => {
it("should return INTERNAL_SERVER_ERROR when response is not ok", async () => {
const mockResponse = responseConstants.INTERNAL_SERVER_ERROR;
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
params: {
roleId: roleId,
},
Expand All @@ -81,7 +81,7 @@ describe("deleteGuildRoleHandler", () => {
it("should return INTERNAL_SERVER_ERROR when token is not verified", async () => {
const mockResponse = responseConstants.INTERNAL_SERVER_ERROR;
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
method: "DELETE",
params: {
roleId: roleId,
Expand All @@ -103,7 +103,7 @@ describe("deleteGuildRoleHandler", () => {
status: 204,
});
const mockRequest = generateDummyRequestObject({
url: "/guildroles",
url: "/roles",
method: "DELETE",
params: {
roleId: roleId,
Expand Down

0 comments on commit f2cabae

Please sign in to comment.