@autobusal/providers 1.0.57 → 1.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,8 @@ import { error as systemError } from '@autobusal/utilities';
5
5
 
6
6
  const apiClient = axios.create({
7
7
  baseURL: import.meta.env.VITE_API_OBT,
8
- withCredentials: true
8
+ withCredentials: true,
9
+ withXSRFToken: true
9
10
  });
10
11
 
11
12
  apiClient.interceptors.request.use(
@@ -26,7 +27,9 @@ apiClient.interceptors.response.use(response => (
26
27
  if (error.response) {
27
28
  // if we have a 401, we go to the logout page
28
29
  if (error.response.status === 401) {
29
- alert(401);
30
+ // if (!window.location.hash) {
31
+ // window.location.href = '/account/logout#redirect';
32
+ // }
30
33
  }
31
34
 
32
35
  // if we have a 422 error, we display the message
@@ -45,6 +48,8 @@ apiClient.interceptors.response.use(response => (
45
48
  } else {
46
49
  alert('OPAOPA!');
47
50
  }
51
+
52
+ return Promise.reject(error);
48
53
  });
49
54
 
50
55
  export default apiClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }
package/services.ts CHANGED
@@ -12,7 +12,6 @@ export const GetSettings = (): UseSuspenseQueryResult<SettingsData> => (
12
12
  .then(response => (
13
13
  response.data
14
14
  ))
15
- .catch(() => {})
16
15
  ),
17
16
  staleTime: Infinity
18
17
  })
@@ -31,7 +30,6 @@ export const GetMenu = (): UseSuspenseQueryResult<MenuData> => {
31
30
 
32
31
  return {};
33
32
  })
34
- .catch(() => {})
35
33
  )
36
34
  })
37
35
  };
package/types/users.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export interface UserData {
2
2
  id: number
3
3
  name: string
4
- type: 'operator'
4
+ type: 'operator' | 'financer'
5
5
  verified: Date
6
6
  status: number
7
7
  funds: string