Files
myeasycms-v2/apps/web/app/api/db/webhook/route.ts
giancarlo 406739d96d Refactor Supabase server client and improve team management features
Refactored Supabase server component client to improve type safety. Improved team account management by adjusting role data providers to consider account IDs, and adjusted invite member functionality to use account IDs and slugs. Enhanced invitation update dialog by adding account parameter. Fixed database webhook URLs in seed.sql. Overall, these changes enhance the robustness and usability of the team management functionalities.
2024-04-03 22:34:12 +08:00

21 lines
483 B
TypeScript

import { z } from 'zod';
import { DatabaseWebhookHandlerService } from '@kit/database-webhooks';
const webhooksSecret = z
.string({
description: `The secret used to verify the webhook signature`,
})
.min(1)
.parse(process.env.SUPABASE_DB_WEBHOOK_SECRET);
const service = new DatabaseWebhookHandlerService();
export async function POST(request: Request) {
await service.handleWebhook(request, webhooksSecret);
return new Response(null, {
status: 200,
});
}