Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change API endpoint name for update #239

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ router.delete("/roles", removeGuildRoleHandler);

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

router.post("/task/update", sendTaskUpdatesHandler);
router.post("/progress", sendTaskUpdatesHandler);

router.post("/", async (request, env, ctx: ExecutionContext) => {
const message: discordMessageRequest = await request.json();
Expand Down Expand Up @@ -86,7 +86,7 @@ export default {
env: env,
ctx: ExecutionContext
): Promise<Response> {
const apiUrls = ["/invite", "/roles", "/profile/blocked", "/task/update"];
const apiUrls = ["/invite", "/roles", "/profile/blocked", "/progress"];
const url = new URL(request.url);
if (request.method === "POST" && !apiUrls.includes(url.pathname)) {
const isVerifiedRequest = await verifyBot(request, env);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/handlers/taskUpdateHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("sendTaskUpdatesHandler", () => {
});

it("should return Bad Signature object if no auth headers provided", async () => {
const mockRequest = generateDummyRequestObject({ url: "/task/update" });
const mockRequest = generateDummyRequestObject({ url: "/progress" });
const result: JSONResponse = await sendTaskUpdatesHandler(
mockRequest,
mockEnv
Expand All @@ -47,7 +47,7 @@ describe("sendTaskUpdatesHandler", () => {
});
it("should return success response if task update is sent successfully", async () => {
const mockRequest = generateDummyRequestObject({
url: "/task/update",
url: "/progress",
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down
Loading