add medreport schema
This commit is contained in:
@@ -21,6 +21,7 @@ export function usePersonalAccountData(
|
||||
}
|
||||
|
||||
const response = await client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.select()
|
||||
.eq('primary_owner_user_id', userId)
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
import { useSupabase } from '@kit/supabase/hooks/use-supabase';
|
||||
|
||||
type UpdateData = Database['public']['Tables']['accounts']['Update'];
|
||||
type UpdateData = Database['medreport']['Tables']['accounts']['Update'];
|
||||
|
||||
export function useUpdateAccountData(accountId: string) {
|
||||
const client = useSupabase();
|
||||
@@ -11,9 +11,13 @@ export function useUpdateAccountData(accountId: string) {
|
||||
const mutationKey = ['account:data', accountId];
|
||||
|
||||
const mutationFn = async (data: UpdateData) => {
|
||||
const response = await client.from('accounts').update(data).match({
|
||||
id: accountId,
|
||||
});
|
||||
const response = await client
|
||||
.schema('medreport')
|
||||
.from('accounts')
|
||||
.update(data)
|
||||
.match({
|
||||
id: accountId,
|
||||
});
|
||||
|
||||
if (response.error) {
|
||||
throw response.error;
|
||||
|
||||
Reference in New Issue
Block a user