From 00054f817d4171866a7acdf5cc221516f1c0837a Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 13:21:16 +0000 Subject: [PATCH] Fix edge function serve wrap Add missing serve() wrapper and correct CORS configuration in supabase/functions/process-selective-approval/index.ts, and import necessary modules. This ensures the edge function handles requests and applies proper CORS headers. --- supabase/functions/process-selective-approval/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supabase/functions/process-selective-approval/index.ts b/supabase/functions/process-selective-approval/index.ts index 47b3fd77..3191f3df 100644 --- a/supabase/functions/process-selective-approval/index.ts +++ b/supabase/functions/process-selective-approval/index.ts @@ -1,4 +1,6 @@ +import { serve } from 'https://deno.land/std@0.190.0/http/server.ts'; import { createEdgeFunction } from '../_shared/edgeFunctionWrapper.ts'; +import { corsHeadersWithTracing } from '../_shared/cors.ts'; import { addSpanEvent, setSpanAttributes, @@ -289,13 +291,11 @@ const handler = async (req: Request, context: { supabase: any; user: any; span: }; // Create edge function with automatic error handling, CORS, auth, and logging -createEdgeFunction( +serve(createEdgeFunction( { name: 'process-selective-approval', requireAuth: true, - corsEnabled: true, - enableTracing: true, - rateLimitTier: 'moderate' + corsHeaders: corsHeadersWithTracing, }, handler -); +));