1 import { createClient } from '@supabase/supabase-js'
2 import { single, collection } from './supabase';
3 import { supabase } from '$lib/config/config';
5 import type { Topic } from '$lib/data/types';
7 const client = createClient(supabase.url, supabase.key);
9 export const topic = (id: string, withPosts = false) => single<Topic>(client
11 .select(withPosts ? `*,
21 export const topicsForForum = (id: string) => collection<Topic>(client
26 export const topicsForTag = (id: string) => collection<Topic>(client