mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:31:12 -05:00
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.
This commit is contained in:
@@ -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
|
||||
);
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user