feat(#35): Wire toasts into existing user actions
This commit is contained in:
@@ -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