1
- import { host , restApiRoot , port } from '~/server/config.json' ;
1
+ import { host , restApiRoot , port } from '~/server/config.json' ;
2
2
import axios from 'axios' ;
3
3
4
4
const Storage = window . localStorage ;
@@ -28,11 +28,11 @@ function addTokenFromLocalStorage(http) {
28
28
29
29
const http = axios . create ( {
30
30
baseURL : `http://${ host } :${ port } ${ restApiRoot } ` ,
31
- } ) ;
31
+ } ) ; fi
32
32
33
33
// Current setLoading function
34
34
let setLoading = ( ) => {
35
- throw Error ( ' setLoadingFunction not defined') ;
35
+ console . warn ( '[loopback service] setLoadingFunction is not defined') ;
36
36
} ;
37
37
38
38
http . setLoadingFunction = ( fn ) => {
@@ -50,10 +50,11 @@ http.removeToken = () => {
50
50
removeTokenFromLocalStorage ( ) ;
51
51
} ;
52
52
53
- http . find = ( endpoint , filter ) => http . get ( endpoint , { params : { filter} } ) ;
53
+ http . find = ( endpoint , filter ) => http . get ( endpoint , { params : { filter } } ) ;
54
54
55
55
/* Response Interceptors */
56
56
const interceptResErrors = ( err ) => {
57
+ // console.log('error', err);
57
58
setLoading ( false , err . response . config . uid ) ;
58
59
try {
59
60
err = Object . assign ( new Error ( ) , err . response . data . error ) ;
0 commit comments