From 43cc7b8852a45439f7729ff27540d4ef48d59e39 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 10 Nov 2022 21:53:02 -0500 Subject: [PATCH] fix(striker-ui): trigger error in axios based on status code --- striker-ui/lib/singletons/mainAxiosInstance.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/striker-ui/lib/singletons/mainAxiosInstance.ts b/striker-ui/lib/singletons/mainAxiosInstance.ts index 0c28780f..2700f478 100644 --- a/striker-ui/lib/singletons/mainAxiosInstance.ts +++ b/striker-ui/lib/singletons/mainAxiosInstance.ts @@ -1,7 +1,10 @@ import { Axios } from 'axios'; +import API_BASE_URL from '../consts/API_BASE_URL'; + 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;