fix(striker-ui): trigger error in axios based on status code

main
Tsu-ba-me 2 years ago
parent 2ffe2c6f61
commit 43cc7b8852
  1. 5
      striker-ui/lib/singletons/mainAxiosInstance.ts

@ -1,7 +1,10 @@
import { Axios } from 'axios'; import { Axios } from 'axios';
import API_BASE_URL from '../consts/API_BASE_URL';
const mainAxiosInstance = new Axios({ const mainAxiosInstance = new Axios({
baseURL: process.env.NEXT_PUBLIC_API_URL?.replace('/cgi-bin', '/api'), baseURL: API_BASE_URL,
validateStatus: (status) => status < 400,
}); });
export default mainAxiosInstance; export default mainAxiosInstance;

Loading…
Cancel
Save