💄 fix refresh
This commit is contained in:
1 parent
d892c502d1
commit
b94d908339
1 file changed
+3
-1
+3
-1
@@ -204,6 +204,9 @@ const Admin = (props: Props) => {
|
||||
const onChangeRole = async (e: React.ChangeEvent<HTMLSelectElement>, user: User) => {
|
||||
const body = { selectedUserEmail: user.email, selectedUserRole: e.target.value }
|
||||
fetcher('/api/user/update', 'PUT', body)
|
||||
setTimeout(() => {
|
||||
router.refresh();
|
||||
}, 2000)
|
||||
};
|
||||
|
||||
const onDeleteUser = async (userEmail: string) => {
|
||||
@@ -366,7 +369,6 @@ const Admin = (props: Props) => {
|
||||
<option value="SELLER">Vendeur</option>
|
||||
<option value="ADMIN">Administrateur</option>
|
||||
{isSuperAdmin && <option value="SUPERADMIN">SuperAdmin</option>}
|
||||
|
||||
</select>
|
||||
</td>}
|
||||
{info.role !== Role.SELLER && <td><button className="btn btn-primary" onClick={() => onDeleteUser(info.email)}>Supprimer</button></td>}
|
||||
|
||||
Reference in new issue
Block a user