mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(roles): show the correct error message (#7089)
This commit is contained in:
@@ -174,12 +174,11 @@ export const deleteUser = async (formData: FormData) => {
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
try {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData?.message || "Failed to delete the user");
|
||||
} catch {
|
||||
throw new Error("Failed to delete the user");
|
||||
}
|
||||
// Parse error response
|
||||
const errorData = await response.json();
|
||||
return {
|
||||
errors: errorData.errors || [{ detail: "Failed to delete the user" }],
|
||||
};
|
||||
}
|
||||
|
||||
let data = null;
|
||||
|
||||
Reference in New Issue
Block a user