Browse Source

fix: should not intercept normal response

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 3 tuần trước cách đây
mục cha
commit
5c4bf72898

+ 5 - 2
client/src/components/layout/GlobalEffect.tsx

@@ -39,9 +39,12 @@ const GlobalEffect = ({ children }: { children: React.ReactNode }) => {
             response.data &&
             response.data &&
             response.data.data &&
             response.data.data &&
             ((typeof response.data.data.error_code === 'string' &&
             ((typeof response.data.data.error_code === 'string' &&
-              response.data.data.error_code !== 'Success') ||
+              response.data.data.error_code !== 'Success' &&
+              response.data.data.error_code !== '') ||
               (response.data.data.status &&
               (response.data.data.status &&
-                response.data.data.status.error_code !== 'Success'));
+                response.data.data.status.error_code &&
+                response.data.data.status.error_code !== 'Success' &&
+                response.data.data.status.error_code !== ''));
 
 
           if (isHttpError) {
           if (isHttpError) {
             openSnackBar(response.data.message, 'warning');
             openSnackBar(response.data.message, 'warning');