Deleting user now works, and forces you to allocate tasks from each user to another user before deleting them
This commit is contained in:
@@ -32,7 +32,12 @@ class ApiService {
|
||||
if (response.status === 401) {
|
||||
this.logout();
|
||||
}
|
||||
throw new Error(`API Error: ${response.statusText}`);
|
||||
let errorMsg = response.statusText;
|
||||
try {
|
||||
const data = await response.json();
|
||||
if (data && data.detail) errorMsg = data.detail;
|
||||
} catch (e) {}
|
||||
throw new Error(`API Error: ${errorMsg}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
|
||||
Reference in New Issue
Block a user