Explorar o código

Fix: Super admin button visibility

Modified the `useSuperUser` hook to pass the user's email to the `is_super_user` RPC function. This ensures the "Modifier" button is correctly displayed for super admins.
gpt-engineer-app[bot] hai 5 meses
pai
achega
2d566c10f1
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/hooks/useSuperUser.tsx

+ 3 - 1
src/hooks/useSuperUser.tsx

@@ -16,7 +16,9 @@ export function useSuperUser() {
     }
 
     try {
-      const { data, error } = await supabase.rpc('is_super_user');
+      const { data, error } = await supabase.rpc('is_super_user', { 
+        user_email: user.email 
+      });
       
       if (error) {
         console.error('Error checking super user status:', error);