X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fmodels%2Fuser.js;h=351ffef86244900e2484a1ec5b7ea3f459bc942c;hb=68a3b9f2aacb0225ae8b883b561b144bac339cbd;hp=0bbd638d497bce4ad060732b5d4c5a55493af71c;hpb=9bd2662976a75d3b03364cdbe6419e57c80f99a6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/user.js b/server/models/user.js index 0bbd638d4..351ffef86 100644 --- a/server/models/user.js +++ b/server/models/user.js @@ -21,6 +21,7 @@ UserSchema.methods = { UserSchema.statics = { getByUsernameAndPassword: getByUsernameAndPassword, list: list, + loadById: loadById, loadByUsername: loadByUsername } @@ -36,6 +37,10 @@ function list (callback) { return this.find(callback) } +function loadById (id, callback) { + return this.findById(id, callback) +} + function loadByUsername (username, callback) { return this.findOne({ username: username }, callback) }