]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/stores/forums.ts
Start migration to supabase
[rbdr/forum] / src / lib / stores / forums.ts
index cb62b5a037f2cf5db6e9175497de3f07156bda14..0ff09f7b5f6eca3b3e268ef72fabe1b0372733a3 100644 (file)
@@ -1,5 +1,9 @@
 import { store } from './apollo';
 import { GET_FORUM, GET_FORUMS } from '$lib/data/queries';
 
 import { store } from './apollo';
 import { GET_FORUM, GET_FORUMS } from '$lib/data/queries';
 
-export const getForum = (id: string) => store({ key: 'forum', query: GET_FORUM, variables: { id } });
-export const getForums = () => store({ key: 'forums', query: GET_FORUMS, initialValue: [] });
+import type { Forum } from '$lib/data/types';
+
+export const getForum = (id: string) =>
+       store<Forum>({ key: 'forum', query: GET_FORUM, variables: { id } });
+export const getForums = () =>
+       store<Forum[]>({ key: 'forumsCollection', query: GET_FORUMS, initialValue: [] });