]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/stores/forums.ts
Don't remember what this WIP was about
[rbdr/forum] / src / lib / stores / forums.ts
index 40a3f2cc89d580c0abb8e477926558f9471701a5..0bf41f603ed897648579da892e812d68c696c619 100644 (file)
@@ -1,4 +1,4 @@
-import { createClient } from '@supabase/supabase-js'
+import { createClient } from '@supabase/supabase-js';
 import { single, collection } from './supabase';
 import { supabase } from '$lib/config/config';
 
 import { single, collection } from './supabase';
 import { supabase } from '$lib/config/config';
 
@@ -6,13 +6,20 @@ import type { Forum } from '$lib/data/types';
 
 const client = createClient(supabase.url, supabase.key);
 
 
 const client = createClient(supabase.url, supabase.key);
 
-export const forum = (id: string, withTopics = false) => single<Forum>(client
-  .from('forums')
-  .select(withTopics ? `*, 
+export const forum = (id: string, withTopics = false) =>
+       single<Forum>(
+               client
+                       .from('forums')
+                       .select(
+                               withTopics
+                                       ? `*, 
     topics (
       *
     )
     topics (
       *
     )
-  `: '*' )
-  .eq('id', id),
-  null);
+  `
+                                       : '*'
+                       )
+                       .eq('id', id),
+               null
+       );
 export const forums = collection<Forum>(client.from('forums').select('*'), []);
 export const forums = collection<Forum>(client.from('forums').select('*'), []);