mirror of
https://github.com/pinry/pinry.git
synced 2025-11-16 09:55:50 +01:00
Fix: Remove console.log in api.js
This commit is contained in:
committed by
Isaac Bythewood
parent
7956c93846
commit
58a0b663aa
@@ -35,6 +35,32 @@ function fetchPinsForBoard(boardId) {
|
|||||||
|
|
||||||
const User = {
|
const User = {
|
||||||
storageKey: 'pinry.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() {
|
logOut() {
|
||||||
const self = this;
|
const self = this;
|
||||||
return new Promise(
|
return new Promise(
|
||||||
|
|||||||
Reference in New Issue
Block a user