Se inserta el plan de estudios y se mandan crear los datos generales en segundo plano, y la edge funcion de openai-webhook-responses recibe la respuesta para actualizar el plan de estudio con los datos generales
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
import type { Database } from "../_shared/database.types.ts";
|
||||
|
||||
const SUPABASE_URL = Deno.env.get("SUPABASE_URL");
|
||||
const SUPABASE_ANON_KEY = Deno.env.get("SUPABASE_ANON_KEY");
|
||||
const SUPABASE_SERVICE_ROLE_KEY = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY");
|
||||
|
||||
if (!SUPABASE_URL || !SUPABASE_ANON_KEY) {
|
||||
if (!SUPABASE_URL || (!SUPABASE_SERVICE_ROLE_KEY && !SUPABASE_ANON_KEY)) {
|
||||
console.warn("Missing Supabase environment variables");
|
||||
}
|
||||
|
||||
const supabase = createClient(
|
||||
const supabaseKey = (SUPABASE_SERVICE_ROLE_KEY ?? SUPABASE_ANON_KEY) as string;
|
||||
|
||||
const supabase = createClient<Database>(
|
||||
SUPABASE_URL as string,
|
||||
SUPABASE_ANON_KEY as string,
|
||||
supabaseKey,
|
||||
);
|
||||
|
||||
export { supabase };
|
||||
|
||||
Reference in New Issue
Block a user