1 import { createClient } from '@supabase/supabase-js'
2 import { single, collection } from './supabase';
3 import { supabase } from '$lib/config/config';
5 import type { Forum } from '$lib/data/types';
7 const client = createClient(supabase.url, supabase.key);
9 export const forum = (id: string, withTopics = false) => single<Forum>(client
11 .select(withTopics ? `*,
18 export const forums = collection<Forum>(client.from('forums').select('*'), []);