Show bad request message in ui
When a username already exists the api returns 400, this should be shown to the user.
This commit is contained in:
parent
c35df51634
commit
b5a224c9ae
|
|
@ -24,10 +24,16 @@ axios.interceptors.response.use(undefined, (error) => {
|
|||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
if (error.response.status === 401) {
|
||||
const status = error.response.status;
|
||||
|
||||
if (status === 401) {
|
||||
tryAuthenticate().then(() => snack('Could not complete request.'));
|
||||
}
|
||||
|
||||
if (status === 400) {
|
||||
snack(error.response.data.error + ': ' + error.response.data.errorDescription);
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue