add health benefit form
fix super admin
This commit is contained in:
@@ -7,11 +7,16 @@ import { Database } from '@kit/supabase/database';
|
||||
* @description Check if the current user is a super admin.
|
||||
* @param client
|
||||
*/
|
||||
export async function isCompanyAdmin(client: SupabaseClient<Database>, accountSlug: string) {
|
||||
export async function isCompanyAdmin(
|
||||
client: SupabaseClient<Database>,
|
||||
accountSlug: string,
|
||||
) {
|
||||
try {
|
||||
const { data, error } = await client.rpc('is_company_admin', {
|
||||
account_slug: accountSlug,
|
||||
});
|
||||
const { data, error } = await client
|
||||
.schema('medreport')
|
||||
.rpc('is_company_admin', {
|
||||
account_slug: accountSlug,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user