nice clean
This commit is contained in:
parent
a6a343ba25
commit
29eacb2578
@ -20,7 +20,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { useAuth } from '../context/useAuth';
|
import { useAuth } from '../context/useAuth';
|
||||||
|
|
||||||
const AdminUsersPage = () => {
|
const AdminUsersPage = () => {
|
||||||
const { user: currentUser, logout } = useAuth();
|
const { user, logout } = useAuth();
|
||||||
const [users, setUsers] = useState([]);
|
const [users, setUsers] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [error, setError] = useState('');
|
const [error, setError] = useState('');
|
||||||
@ -100,13 +100,8 @@ const AdminUsersPage = () => {
|
|||||||
try {
|
try {
|
||||||
await userApi.deleteUser(userId);
|
await userApi.deleteUser(userId);
|
||||||
|
|
||||||
if (String(userId) === String(getUserId(currentUser))) {
|
if (String(userId) === String(getUserId(user))) {
|
||||||
console.log('SUPPRESSION DE MOI');
|
|
||||||
console.log('currentUser:', currentUser);
|
|
||||||
|
|
||||||
logout();
|
logout();
|
||||||
|
|
||||||
console.log('LOGOUT APPELÉ');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user