add health benefit form
fix super admin
This commit is contained in:
@@ -3,11 +3,6 @@ import { BadgeX, Ban, ShieldPlus, VenetianMask } from 'lucide-react';
|
||||
import { Tables } from '@kit/supabase/database';
|
||||
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import {
|
||||
AccountInvitationsTable,
|
||||
AccountMembersTable,
|
||||
InviteMembersDialogContainer,
|
||||
} from '@kit/team-accounts/components';
|
||||
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
|
||||
import { AppBreadcrumbs } from '@kit/ui/app-breadcrumbs';
|
||||
import { Badge } from '@kit/ui/badge';
|
||||
|
||||
@@ -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`);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user