diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-09 21:44:45 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-09 21:44:45 +0200 |
commit | 68a3b9f2aacb0225ae8b883b561b144bac339cbd (patch) | |
tree | e3d75b7952073ba4b2ef4b62ed57ded9f3cf0f1e /server/models/user.js | |
parent | 45b81debd6d6647980da7ad5a984bafa37cb79ea (diff) | |
download | PeerTube-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/user.js')
-rw-r--r-- | server/models/user.js | 5 |
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 = { | |||
21 | UserSchema.statics = { | 21 | UserSchema.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 | ||
40 | function loadById (id, callback) { | ||
41 | return this.findById(id, callback) | ||
42 | } | ||
43 | |||
39 | function loadByUsername (username, callback) { | 44 | function loadByUsername (username, callback) { |
40 | return this.findOne({ username: username }, callback) | 45 | return this.findOne({ username: username }, callback) |
41 | } | 46 | } |