use params prop instead of inline query params

This commit is contained in:
Ben Wheeler 2019-08-27 12:26:56 -04:00
parent ee8cdac748
commit 55cb112ee9

View file

@ -81,8 +81,9 @@ module.exports.validateEmailLocally = email => {
module.exports.validateEmailRemotely = email => ( module.exports.validateEmailRemotely = email => (
new Promise(resolve => { new Promise(resolve => {
api({ api({
uri: `/accounts/check_email/?email=${email}`, host: '', // not handled by API; use existing infrastructure
host: '' // Not handled by the API, use existing infrastructure params: {email: email},
uri: '/accounts/check_email/'
}, (err, body, res) => { }, (err, body, res) => {
if (err || res.statusCode !== 200 || !body || body.length < 1 || !body[0].msg) { if (err || res.statusCode !== 200 || !body || body.length < 1 || !body[0].msg) {
resolve({valid: false, errMsgId: 'general.apiError'}); resolve({valid: false, errMsgId: 'general.apiError'});