Skip to content

Commit 3413b45

Browse files
author
Walker Leite
committed
fix(loopback): change error to warning in console
1 parent 1063f8d commit 3413b45

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

template/client/services/loopback.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {host, restApiRoot, port} from '~/server/config.json';
1+
import { host, restApiRoot, port } from '~/server/config.json';
22
import axios from 'axios';
33

44
const Storage = window.localStorage;
@@ -28,11 +28,11 @@ function addTokenFromLocalStorage(http) {
2828

2929
const http = axios.create({
3030
baseURL: `http://${host}:${port}${restApiRoot}`,
31-
});
31+
});fi
3232

3333
// Current setLoading function
3434
let setLoading = () => {
35-
throw Error('setLoadingFunction not defined');
35+
console.warn('[loopback service] setLoadingFunction is not defined');
3636
};
3737

3838
http.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 */
5656
const 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

Comments
 (0)