overleaf/services/web/app/coffee/Features/User/UserLocator.coffee
Tim Alby bbaca91e57 add UserGetter#getUserByMainEmail
Use only that method to find users by email.
2018-05-28 14:11:09 +02:00

15 lines
392 B
CoffeeScript

mongojs = require("../../infrastructure/mongojs")
metrics = require("metrics-sharelatex")
db = mongojs.db
ObjectId = mongojs.ObjectId
logger = require('logger-sharelatex')
module.exports = UserLocator =
findById: (_id, callback)->
db.users.findOne _id:ObjectId(_id+""), callback
[
'findById',
].map (method) ->
metrics.timeAsyncMethod UserLocator, method, 'mongo.UserLocator', logger