add real data to ai
This commit is contained in:
@@ -425,6 +425,31 @@ class UserAnalysesApi {
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
async getAllUserAnalysisResponses(): Promise<
|
||||
Database['medreport']['Functions']['get_latest_analysis_response_elements_for_current_user']['Returns']
|
||||
> {
|
||||
const {
|
||||
data: { user },
|
||||
} = await this.client.auth.getUser();
|
||||
|
||||
if (!user) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const { data, error } = await this.client
|
||||
.schema('medreport')
|
||||
.rpc('get_latest_analysis_response_elements_for_current_user', {
|
||||
p_user_id: user.id,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('Error fetching user analysis responses: ', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
export function createUserAnalysesApi(client: SupabaseClient<Database>) {
|
||||
|
||||
Reference in New Issue
Block a user