mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
chore: use cuids for webhooks
This commit is contained in:
@ -7,7 +7,9 @@ import { validateApiToken } from './validateApiToken';
|
||||
export const subscribeHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
try {
|
||||
const { authorization } = req.headers;
|
||||
|
||||
const { webhookUrl, eventTrigger } = req.body;
|
||||
|
||||
const user = await validateApiToken({ authorization });
|
||||
|
||||
const createdWebhook = await prisma.webhook.create({
|
||||
|
||||
@ -7,7 +7,9 @@ import { validateApiToken } from './validateApiToken';
|
||||
export const unsubscribeHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
try {
|
||||
const { authorization } = req.headers;
|
||||
|
||||
const { webhookId } = req.body;
|
||||
|
||||
const user = await validateApiToken({ authorization });
|
||||
|
||||
const deletedWebhook = await prisma.webhook.delete({
|
||||
|
||||
Reference in New Issue
Block a user