Fix: Remove console.log in api.js

This commit is contained in:
winkidney
2019-11-29 16:26:11 +08:00
committed by Isaac Bythewood
parent 7956c93846
commit 58a0b663aa

View File

@@ -35,6 +35,32 @@ function fetchPinsForBoard(boardId) {
const User = {
storageKey: 'pinry.user',
logIn(username, password) {
const url = `${API_PREFIX}profile/login/`;
return new Promise(
(resolve, reject) => {
const p = axios.post(
url,
{
username,
password,
},
);
p.then(
(resp) => {
if (resp.status !== 200) {
reject(resp);
}
resolve(resp.data);
},
(error) => {
console.log('Failed to log in due to unexpected error:', error);
reject(error);
},
);
},
);
},
logOut() {
const self = this;
return new Promise(