Explorar el 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] hace 5 meses
padre
commit
2d566c10f1
Se han modificado 1 ficheros con 3 adiciones y 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);