Created
May 18, 2018 14:51
-
-
Save cannap/594fe4f17f395aff0c549e26e61ab404 to your computer and use it in GitHub Desktop.
This file contains 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
async function findOrCreateUser(user, field, value) { | |
const user = await User.where({ | |
[field]: value | |
}).fetch() | |
if (user) return user | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment