MED-109: add doctor role and basic view (#45)
* MED-109: add doctor role and basic view * add role to accounts * remove old super admin and doctor sql
This commit is contained in:
@@ -4,9 +4,13 @@ import { Database } from '@kit/supabase/database';
|
||||
|
||||
import { UserAnalysis } from '../types/accounts';
|
||||
|
||||
export type AccountWithParams = Database['medreport']['Tables']['accounts']['Row'] & {
|
||||
account_params: Pick<Database['medreport']['Tables']['account_params']['Row'], 'weight' | 'height'> | null;
|
||||
};
|
||||
export type AccountWithParams =
|
||||
Database['medreport']['Tables']['accounts']['Row'] & {
|
||||
account_params: Pick<
|
||||
Database['medreport']['Tables']['account_params']['Row'],
|
||||
'weight' | 'height'
|
||||
> | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Class representing an API for interacting with user accounts.
|
||||
@@ -79,7 +83,8 @@ class AccountsApi {
|
||||
accounts (
|
||||
name,
|
||||
slug,
|
||||
picture_url
|
||||
picture_url,
|
||||
application_role
|
||||
)
|
||||
`,
|
||||
)
|
||||
@@ -95,6 +100,7 @@ class AccountsApi {
|
||||
label: accounts.name,
|
||||
value: accounts.slug,
|
||||
image: accounts.picture_url,
|
||||
application_role: accounts.application_role,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -209,11 +215,12 @@ class AccountsApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
return analysisResponses
|
||||
.map((r) => ({
|
||||
...r,
|
||||
elements: analysisResponseElements.filter((e) => e.analysis_response_id === r.id),
|
||||
}));
|
||||
return analysisResponses.map((r) => ({
|
||||
...r,
|
||||
elements: analysisResponseElements.filter(
|
||||
(e) => e.analysis_response_id === r.id,
|
||||
),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user