diff options
Diffstat (limited to 'src/lib/Database')
| -rw-r--r-- | src/lib/Database/groups.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Database/groups.ts b/src/lib/Database/groups.ts index e3e392b8..097d6f89 100644 --- a/src/lib/Database/groups.ts +++ b/src/lib/Database/groups.ts @@ -24,9 +24,9 @@ export const getGroups = async () => { }; export const getGroup = async (slug: string) => { - const { data, error } = await supabase.from('groups').select('*').eq('slug', slug); + const { data, error } = await supabase.from('groups').select('*').eq('anilist_username', slug); - if (error) return []; + if (error || data.length === 0) return null; - return data as Group[]; + return data[0] as Group; }; |