Fix error handler on controller

This commit is contained in:
Moe Poi ~ 2021-11-17 15:24:29 +07:00
parent 1dadd2caf0
commit d43be73f0c

View file

@ -36,7 +36,7 @@ function register(email, password, first_name, last_name) {
} }
return axios.post(HOST + '/register', params, conf) return axios.post(HOST + '/register', params, conf)
.then(response => response.status) .then(response => response.status)
.catch(error => console.log(error)) .catch(error => [error.status, []])
} }
function login(email, password, ua, ip) { function login(email, password, ua, ip) {
@ -53,7 +53,7 @@ function login(email, password, ua, ip) {
} }
return axios.post(HOST + '/login', params, conf) return axios.post(HOST + '/login', params, conf)
.then(response => [response.status, response.data]) .then(response => [response.status, response.data])
.catch(error => console.log(error)) .catch(error => [error.status, []])
} }
module.exports = { module.exports = {