webhooks: add a webhook from its own pagea3f4d6e13 days ago22 lines · 728 B | 1 | import { notFound } from "next/navigation"; |
| 2 | |
| 3 | import { CreateWebhookCard } |
| 4 | import { createServerClient } |
| 5 | |
| 6 | export default async function |
| 7 | params, |
| 8 | }: PageProps< |
| 9 | const { username: |
| 10 | const client = |
| 11 | const { data |
| 12 | params: { path: { |
| 13 | }); |
| 14 | if (!data) |
| 15 | |
| 16 | return ( |
| 17 | <CreateWebhookCard |
| 18 | owner={{ kind: |
| 19 | hint="Receives the events of every repository in the organization. Ghost sends a ping right away." |
| 20 | /> |
| 21 | ); |
| 22 | } |
from
"
@/components/webhooks/create-webhook-card
"
;
from
"
@/lib/api/server
"
;
NewOrganizationWebhookPage
(
{
"
/[username]/settings/webhooks/new
"
>
)
{
slug
}
=
await
params
;
await
createServerClient
()
;
}
=
await
client
.
GET
(
"
/api/organizations/{slug}/webhooks
"
,
{
slug
}
}
,
notFound
()
;
"
organization
"
,
slug
}
}