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:
@@ -20,7 +20,7 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzd
|
||||
NEXT_PUBLIC_REQUIRE_EMAIL_CONFIRMATION=true
|
||||
|
||||
## THIS IS FOR DEVELOPMENT ONLY - DO NOT USE IN PRODUCTION
|
||||
SUPABASE_WEBHOOK_SECRET=WEBHOOKSECRET
|
||||
SUPABASE_DB_WEBHOOK_SECRET=WEBHOOKSECRET
|
||||
|
||||
EMAIL_SENDER=test@makerkit.dev
|
||||
EMAIL_PORT=54325
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user