add health benefit form

fix super admin
This commit is contained in:
Danel Kungla
2025-07-23 16:33:24 +03:00
parent 2db67b7f20
commit 86b86c6752
43 changed files with 1329 additions and 561 deletions

View File

@@ -22,9 +22,11 @@ class CreateTeamAccountService {
logger.info(ctx, `Creating new company account...`);
const { error, data } = await this.client.rpc('create_team_account', {
account_name: params.name,
});
const { error, data } = await this.client
.schema('medreport')
.rpc('create_team_account', {
account_name: params.name,
});
if (error) {
logger.error(
@@ -35,7 +37,7 @@ class CreateTeamAccountService {
`Error creating company account`,
);
throw new Error('Error creating company account');
throw new Error('Error creating company account: ' + error);
}
logger.info(ctx, `Company account created successfully`);

View File

@@ -9,7 +9,9 @@ import { Database } from '@kit/supabase/database';
*/
export async function isSuperAdmin(client: SupabaseClient<Database>) {
try {
const { data, error } = await client.rpc('is_super_admin');
const { data, error } = await client
.schema('medreport')
.rpc('is_super_admin');
if (error) {
throw error;