-- Create a simple function to trigger any Edge Function API endpoint
CREATE OR REPLACE FUNCTION api.trigger_function_endpoint(endpoint_path TEXT)
RETURNS VOID AS $$
DECLARE
function_url TEXT;
headers JSONB;
BEGIN
-- Get the complete function URL
function_url := api.get_complete_function_url(endpoint_path);
-- Prepare headers for the HTTP request
headers := api.prepare_function_headers();
-- Make the HTTP POST call
PERFORM net.http_post(
url := function_url,
headers := headers
);
END;
$$ LANGUAGE PLPGSQL SECURITY DEFINER SET search_path = '';
COMMENT ON FUNCTION api.trigger_function_endpoint IS 'Triggers any Supabase Edge Functions API endpoint';
-- Create a simple function to trigger any Edge Function API endpoint
CREATE OR REPLACE FUNCTION api.trigger_function_endpoint(endpoint_path TEXT)
RETURNS VOID AS $$
DECLARE
function_url TEXT;
headers JSONB;
BEGIN
-- Get the complete function URL
function_url := api.get_complete_function_url(endpoint_path);
-- Prepare headers for the HTTP request
headers := api.prepare_function_headers();
-- Make the HTTP POST call
PERFORM net.http_post(
url := function_url,
headers := headers
);
END;
$$ LANGUAGE PLPGSQL SECURITY DEFINER SET search_path = '';
COMMENT ON FUNCTION api.trigger_function_endpoint IS 'Triggers any Supabase Edge Functions API endpoint';