1- import { host , restApiRoot , port } from '~/server/config.json' ;
1+ import { host , restApiRoot , port } from '~/server/config.json' ;
22import axios from 'axios' ;
33
44const Storage = window . localStorage ;
@@ -28,11 +28,11 @@ function addTokenFromLocalStorage(http) {
2828
2929const http = axios . create ( {
3030 baseURL : `http://${ host } :${ port } ${ restApiRoot } ` ,
31- } ) ;
31+ } ) ; fi
3232
3333// Current setLoading function
3434let setLoading = ( ) => {
35- throw Error ( ' setLoadingFunction not defined') ;
35+ console . warn ( '[loopback service] setLoadingFunction is not defined') ;
3636} ;
3737
3838http . setLoadingFunction = ( fn ) => {
@@ -50,10 +50,11 @@ http.removeToken = () => {
5050 removeTokenFromLocalStorage ( ) ;
5151} ;
5252
53- http . find = ( endpoint , filter ) => http . get ( endpoint , { params : { filter} } ) ;
53+ http . find = ( endpoint , filter ) => http . get ( endpoint , { params : { filter } } ) ;
5454
5555/* Response Interceptors */
5656const interceptResErrors = ( err ) => {
57+ // console.log('error', err);
5758 setLoading ( false , err . response . config . uid ) ;
5859 try {
5960 err = Object . assign ( new Error ( ) , err . response . data . error ) ;
0 commit comments