浏览代码

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] 5 月之前
父节点
当前提交
2d566c10f1
共有 1 个文件被更改,包括 3 次插入1 次删除
  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);