Skip to content

Commit

Permalink
fix: webhook endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LeslieLeung committed Jan 15, 2024
1 parent 4b0d811 commit 8c8cce1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions heimdallr/api/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8c8cce1

Please sign in to comment.