INNER CODE UNIT · TypeScript

syncCaseStudies

winstonkoh87/Athena-Public · supabase/functions/sync-athena/index.ts:177

async function syncCaseStudies(supabase: ReturnType<typeof createClient>): Promise<{ synced: number; skipped: number; errors: number }> {
  let synced = 0;
  let skipped = 0;
  let errors = 0;

  try {
    const files = await fetchGitHubDirectory(".context/memories/case_studies");
    
    for (const file of files) {
      if (file.type !== "file" || !file.name.endsWith(".md") || !file.download_url) {
        continue;
      }

      // Check if already exists
      const { data: existing } = await supabase
        .from("case_studies")
        .select("id")
        .eq("file_path", file.path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…