aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/pod.js9
-rw-r--r--server/models/request.js4
2 files changed, 10 insertions, 3 deletions
diff --git a/server/models/pod.js b/server/models/pod.js
index 83ecd732e..8e7dd1fd8 100644
--- a/server/models/pod.js
+++ b/server/models/pod.js
@@ -115,11 +115,18 @@ function list (callback) {
115 return this.findAll().asCallback(callback) 115 return this.findAll().asCallback(callback)
116} 116}
117 117
118function listAllIds (callback) { 118function listAllIds (transaction, callback) {
119 if (!callback) {
120 callback = transaction
121 transaction = null
122 }
123
119 const query = { 124 const query = {
120 attributes: [ 'id' ] 125 attributes: [ 'id' ]
121 } 126 }
122 127
128 if (transaction) query.transaction = transaction
129
123 return this.findAll(query).asCallback(function (err, pods) { 130 return this.findAll(query).asCallback(function (err, pods) {
124 if (err) return callback(err) 131 if (err) return callback(err)
125 132
diff --git a/server/models/request.js b/server/models/request.js
index bae227c05..1d6038044 100644
--- a/server/models/request.js
+++ b/server/models/request.js
@@ -291,8 +291,8 @@ function listWithLimitAndRandom (limit, callback) {
291 order: [ 291 order: [
292 [ 'id', 'ASC' ] 292 [ 'id', 'ASC' ]
293 ], 293 ],
294 offset: start, 294 // offset: start,
295 limit: limit, 295 // limit: limit,
296 include: [ this.sequelize.models.Pod ] 296 include: [ this.sequelize.models.Pod ]
297 } 297 }
298 298