Created
May 25, 2017 11:53
-
-
Save wharley/7bcbb25adce357b23b28fc60420d2699 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const models = require('../../loading/loading'); | |
const Promise = require('bluebird'); | |
module.exports = Promise.method(function userExists(userAttributes) { | |
return models.User | |
.findOne({ | |
where: { | |
email: userAttributes.email | |
} | |
}).then((user) => { | |
if (!user) return false; | |
return user; | |
}).catch((error) => { | |
console.log(error); | |
throw error; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment