From 8c8cce1521dffb52c7aa98a3ce11ec0b21639b21 Mon Sep 17 00:00:00 2001 From: Leslie Leung Date: Tue, 16 Jan 2024 01:59:01 +0800 Subject: [PATCH] fix: webhook endpoint --- heimdallr/api/webhook.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/heimdallr/api/webhook.py b/heimdallr/api/webhook.py index 5a80846..1b1bce6 100644 --- a/heimdallr/api/webhook.py +++ b/heimdallr/api/webhook.py @@ -5,12 +5,12 @@ from heimdallr.api.base import serve from heimdallr.webhook.github_star import GithubStarWebhook -webhook_router = APIRouter() +webhook_router = APIRouter(prefix="/webhook") -@webhook_router.post("/github/star/{channel}") -async def github_star(channel: str, req: Request): +@webhook_router.post("/github/star/{key}") +async def github_star(key: str, req: Request): body = await req.body() webhook = GithubStarWebhook(json.loads(body)) title, msg_body, jump_url = webhook.parse() - return serve(channel, title, msg_body, jump_url=jump_url) + return serve(key, title, msg_body, jump_url=jump_url)