Skip to content

Commit

Permalink
fix: webhook type
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Feb 29, 2024
1 parent c584318 commit e676c3f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@iconify/tailwind": "0.1.4",
"@innei/eslint-config-react-ts": "0.12.2",
"@innei/prettier": "0.12.2",
"@mx-space/webhook": "0.2.2",
"@mx-space/webhook": "0.2.4",
"@next/bundle-analyzer": "14.1.0",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/typography": "0.5.10",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/app/api/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const POST = async (nextreq: NextRequest) => {
})

switch (type) {
case 'health-check': {
case 'health_check': {
return res.status(200).send('OK')
}
case BusinessEvents.NOTE_CREATE:
Expand All @@ -56,6 +56,10 @@ export const POST = async (nextreq: NextRequest) => {
await Promise.all([invalidateCache(CacheKeyMap.AggregateTop)])
return res.status(200).send('OK')
}

default: {
return res.status(200).send('MISS')
}
}
} catch (err) {
if (err instanceof InvalidSignatureError) {
Expand Down

0 comments on commit e676c3f

Please sign in to comment.