mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 10:11:13 -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 { createEdgeFunction } from '../_shared/edgeFunctionWrapper.ts';
|
||||||
|
import { corsHeadersWithTracing } from '../_shared/cors.ts';
|
||||||
import {
|
import {
|
||||||
addSpanEvent,
|
addSpanEvent,
|
||||||
setSpanAttributes,
|
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
|
// Create edge function with automatic error handling, CORS, auth, and logging
|
||||||
createEdgeFunction(
|
serve(createEdgeFunction(
|
||||||
{
|
{
|
||||||
name: 'process-selective-approval',
|
name: 'process-selective-approval',
|
||||||
requireAuth: true,
|
requireAuth: true,
|
||||||
corsEnabled: true,
|
corsHeaders: corsHeadersWithTracing,
|
||||||
enableTracing: true,
|
|
||||||
rateLimitTier: 'moderate'
|
|
||||||
},
|
},
|
||||||
handler
|
handler
|
||||||
);
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user