Skip to content

Commit

Permalink
revert the interceptor improvement because sometimes it causes an inf…
Browse files Browse the repository at this point in the history
…inite loop
  • Loading branch information
pjosh committed May 23, 2018
1 parent d5504f8 commit a62a230
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/javascript/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ const request = {
const axiosInstance = axios.create();
const haveException = checkException(exceptionId);
if (!cacheError && !haveException) {
axiosInstance.interceptors.response.use(response => {
addKey(key, response.data, expire, exceptionId);
return response;
});
axiosInstance.interceptors.response.use(response =>
addKey(key, response.data, expire, exceptionId).then(() => response)
);
}
return axiosInstance.get(url);
}
Expand Down

0 comments on commit a62a230

Please sign in to comment.