Skip to content

Commit a507567

Browse files
author
Shubham Sharma
committed
change API endpoint name for update
1 parent 648a7fa commit a507567

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ router.delete("/roles", removeGuildRoleHandler);
5858

5959
router.post("/profile/blocked", sendProfileBlockedMessage);
6060

61-
router.post("/task/update", sendTaskUpdatesHandler);
61+
router.post("/progress", sendTaskUpdatesHandler);
6262

6363
router.post("/", async (request, env, ctx: ExecutionContext) => {
6464
const message: discordMessageRequest = await request.json();
@@ -86,7 +86,7 @@ export default {
8686
env: env,
8787
ctx: ExecutionContext
8888
): Promise<Response> {
89-
const apiUrls = ["/invite", "/roles", "/profile/blocked", "/task/update"];
89+
const apiUrls = ["/invite", "/roles", "/profile/blocked", "/progress"];
9090
const url = new URL(request.url);
9191
if (request.method === "POST" && !apiUrls.includes(url.pathname)) {
9292
const isVerifiedRequest = await verifyBot(request, env);

tests/unit/handlers/taskUpdateHandler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("sendTaskUpdatesHandler", () => {
3636
});
3737

3838
it("should return Bad Signature object if no auth headers provided", async () => {
39-
const mockRequest = generateDummyRequestObject({ url: "/task/update" });
39+
const mockRequest = generateDummyRequestObject({ url: "/progress" });
4040
const result: JSONResponse = await sendTaskUpdatesHandler(
4141
mockRequest,
4242
mockEnv
@@ -47,7 +47,7 @@ describe("sendTaskUpdatesHandler", () => {
4747
});
4848
it("should return success response if task update is sent successfully", async () => {
4949
const mockRequest = generateDummyRequestObject({
50-
url: "/task/update",
50+
url: "/progress",
5151
method: "POST",
5252
headers: {
5353
"Content-Type": "application/json",

0 commit comments

Comments
 (0)