blob: 388eed3aef9bbbecfe2591474966b704279ed8cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { createClient } from '@supabase/supabase-js';
import { single } from './supabase';
import { supabase } from '$lib/config/config';
import type { Post } from '$lib/data/types';
const client = createClient(supabase.url, supabase.key);
export const post = (id: string, withTopic = false) =>
single<Post>(
client
.from('posts')
.select(
withTopic
? `*,
topic:topic_id (
*
)
`
: '*'
)
.eq('id', id),
null
);
|