Refactor API code and simplify billing display

The code in the webhook API has been refactored to move the DatabaseWebhookHandlerService instance out of the POST function scope. Furthermore, the display of renewal plan details on the billing page has been simplified and certain parts deemed superfluous have been removed. Numerous types and interfaces in the database.types.ts file have also been corrected and formatted for consistency and improved readability.
This commit is contained in:
giancarlo
2024-03-31 15:13:44 +08:00
parent 2c0c616a2d
commit aa12ecd5a2
10 changed files with 1133 additions and 1026 deletions

View File

@@ -9,9 +9,9 @@ const webhooksSecret = z
.min(1)
.parse(process.env.SUPABASE_DB_WEBHOOK_SECRET);
export async function POST(request: Request) {
const service = new DatabaseWebhookHandlerService();
const service = new DatabaseWebhookHandlerService();
export async function POST(request: Request) {
await service.handleWebhook(request, webhooksSecret);
return new Response(null, {