aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/user.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-09-26 22:36:36 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-09-26 22:39:58 +0200
commit00d6b0dda4b1964ab11127851c0fc7106cc0f912 (patch)
tree3759ff8c8724f85f2554c28edf5bcf58a60085cf /server/models/user.js
parent44c5275e1bdd1d4b4c23f7c423034e4293c927b3 (diff)
downloadPeerTube-00d6b0dda4b1964ab11127851c0fc7106cc0f912.tar.gz
PeerTube-00d6b0dda4b1964ab11127851c0fc7106cc0f912.tar.zst
PeerTube-00d6b0dda4b1964ab11127851c0fc7106cc0f912.zip
Add migration (for db, folders...) mechanism
Diffstat (limited to 'server/models/user.js')
-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 db6f1765b..c2c8807f0 100644
--- a/server/models/user.js
+++ b/server/models/user.js
@@ -28,6 +28,7 @@ UserSchema.methods = {
28UserSchema.statics = { 28UserSchema.statics = {
29 countTotal: countTotal, 29 countTotal: countTotal,
30 getByUsername: getByUsername, 30 getByUsername: getByUsername,
31 list: list,
31 listForApi: listForApi, 32 listForApi: listForApi,
32 loadById: loadById, 33 loadById: loadById,
33 loadByUsername: loadByUsername 34 loadByUsername: loadByUsername
@@ -71,6 +72,10 @@ function getByUsername (username) {
71 return this.findOne({ username: username }) 72 return this.findOne({ username: username })
72} 73}
73 74
75function list (callback) {
76 return this.find(callback)
77}
78
74function listForApi (start, count, sort, callback) { 79function listForApi (start, count, sort, callback) {
75 const query = {} 80 const query = {}
76 return modelUtils.listForApiWithCount.call(this, query, start, count, sort, callback) 81 return modelUtils.listForApiWithCount.call(this, query, start, count, sort, callback)