aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-09 21:44:45 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-09 21:44:45 +0200
commit68a3b9f2aacb0225ae8b883b561b144bac339cbd (patch)
treee3d75b7952073ba4b2ef4b62ed57ded9f3cf0f1e /server/models
parent45b81debd6d6647980da7ad5a984bafa37cb79ea (diff)
downloadPeerTube-68a3b9f2aacb0225ae8b883b561b144bac339cbd.tar.gz
PeerTube-68a3b9f2aacb0225ae8b883b561b144bac339cbd.tar.zst
PeerTube-68a3b9f2aacb0225ae8b883b561b144bac339cbd.zip
Server: delete user with the id and not the username
Diffstat (limited to 'server/models')
-rw-r--r--server/models/user.js5
1 files changed, 5 insertions, 0 deletions
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 = {
21UserSchema.statics = { 21UserSchema.statics = {
22 getByUsernameAndPassword: getByUsernameAndPassword, 22 getByUsernameAndPassword: getByUsernameAndPassword,
23 list: list, 23 list: list,
24 loadById: loadById,
24 loadByUsername: loadByUsername 25 loadByUsername: loadByUsername
25} 26}
26 27
@@ -36,6 +37,10 @@ function list (callback) {
36 return this.find(callback) 37 return this.find(callback)
37} 38}
38 39
40function loadById (id, callback) {
41 return this.findById(id, callback)
42}
43
39function loadByUsername (username, callback) { 44function loadByUsername (username, callback) {
40 return this.findOne({ username: username }, callback) 45 return this.findOne({ username: username }, callback)
41} 46}