aboutsummaryrefslogtreecommitdiff
path: root/src/lib/stores/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stores/users.ts')
-rw-r--r--src/lib/stores/users.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/stores/users.ts b/src/lib/stores/users.ts
new file mode 100644
index 0000000..2a56cb5
--- /dev/null
+++ b/src/lib/stores/users.ts
@@ -0,0 +1,13 @@
+import { createClient } from '@supabase/supabase-js'
+import { single } from './supabase';
+import { supabase } from '$lib/config/config';
+
+import type { User } from '$lib/data/types';
+
+const client = createClient(supabase.url, supabase.key);
+
+export const user = (id: string) => single<User>(client
+ .from('users')
+ .select('*')
+ .eq('id', id),
+ null);