diff options
Diffstat (limited to 'server/models/pod/pod.ts')
-rw-r--r-- | server/models/pod/pod.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/models/pod/pod.ts b/server/models/pod/pod.ts index 56918e358..df6412721 100644 --- a/server/models/pod/pod.ts +++ b/server/models/pod/pod.ts | |||
@@ -143,7 +143,7 @@ list = function () { | |||
143 | } | 143 | } |
144 | 144 | ||
145 | listAllIds = function (transaction: Sequelize.Transaction) { | 145 | listAllIds = function (transaction: Sequelize.Transaction) { |
146 | const query: Sequelize.FindOptions = { | 146 | const query = { |
147 | attributes: [ 'id' ], | 147 | attributes: [ 'id' ], |
148 | transaction | 148 | transaction |
149 | } | 149 | } |
@@ -170,9 +170,7 @@ listRandomPodIdsWithRequest = function (limit: number, tableWithPods: string, ta | |||
170 | limit: limit, | 170 | limit: limit, |
171 | where: { | 171 | where: { |
172 | id: { | 172 | id: { |
173 | $in: [ | 173 | $in: Sequelize.literal(`(SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins})`) |
174 | Sequelize.literal(`SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins}`) | ||
175 | ] | ||
176 | } | 174 | } |
177 | } | 175 | } |
178 | } | 176 | } |