Created
August 11, 2019 12:54
-
-
Save acomito/cc96e5ddbfc07af190f9681aedf09cab to your computer and use it in GitHub Desktop.
collections/Users/helpers.js
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
import Users from './model'; | |
const getById = async id => { | |
try { | |
if (!id) return null; | |
// search for inventory item | |
let doc = await Users.findOne({ _id: id }); | |
return doc; // firebase doesnt include the id, so tack it on | |
} catch (err) { | |
console.log(err); | |
} | |
}; | |
export default { | |
getById | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment