Update Supabase clients and refactor codebase
Refactored several Supabase client functions and updated them to use generics. Also, the '@kit/supabase-config' package was removed from the project and all references were replaced accordingly. The project's dependencies were updated as well, including the Supabase package which was upgraded to the latest version.
This commit is contained in:
@@ -2,6 +2,8 @@ import { cache } from 'react';
|
||||
|
||||
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
|
||||
|
||||
import { Database } from '~/lib/database.types';
|
||||
|
||||
export const loadUserWorkspace = cache(async () => {
|
||||
const client = getSupabaseServerComponentClient();
|
||||
|
||||
@@ -15,7 +17,7 @@ export const loadUserWorkspace = cache(async () => {
|
||||
});
|
||||
|
||||
async function loadUserAccounts(
|
||||
client: ReturnType<typeof getSupabaseServerComponentClient>,
|
||||
client: ReturnType<typeof getSupabaseServerComponentClient<Database>>,
|
||||
) {
|
||||
const { data: accounts, error } = await client
|
||||
.from('user_accounts')
|
||||
|
||||
Reference in New Issue
Block a user