feat(#35): Wire toasts into existing user actions
This commit is contained in:
1 parent
187c6b0f99
commit
4c8a3d5dfc
8 files changed
+31
-16
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import {logResource} from "@/service";
|
||||
import {getAccessToken, setAccessToken} from "@/auth/token";
|
||||
import {toast} from "@/toast";
|
||||
import axios, {InternalAxiosRequestConfig} from "axios";
|
||||
import {
|
||||
AcquisitionApi,
|
||||
@@ -86,6 +87,12 @@ mammonAxiosInstance.interceptors.response.use(response => response, async error
|
||||
}
|
||||
onAuthExpired();
|
||||
}
|
||||
|
||||
const status = error.response?.status;
|
||||
|
||||
if (status !== 401 && status !== 403) {
|
||||
toast.error('Something went wrong');
|
||||
}
|
||||
return Promise.reject(error);
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user