Procházet zdrojové kódy

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] před 5 měsíci
rodič
revize
2d566c10f1
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  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);