fix: request current password when deleting users (#5667)
This commit is contained in:
1 parent
59ca0c340a
commit
cfa6c5864e
3 files changed
+29
-8
No files matched your search
@@ -42,8 +42,14 @@ export async function update(
|
||||
});
|
||||
}
|
||||
|
||||
export async function remove(id: number) {
|
||||
export async function remove(
|
||||
id: number,
|
||||
currentPassword: string | null = null
|
||||
) {
|
||||
await fetchURL(`/api/users/${id}`, {
|
||||
method: "DELETE",
|
||||
body: JSON.stringify({
|
||||
...(currentPassword != null ? { current_password: currentPassword } : {}),
|
||||
}),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user