Sort API me.quizs by DESC order
This commit is contained in:
parent
f273506d9d
commit
caffafa7fc
|
@ -87,11 +87,10 @@ async function getQuizs(toActor, filters, proj) {
|
|||
filter.id = filters.id
|
||||
|
||||
let quizs
|
||||
if (proj === null)
|
||||
quizs = await db.table.quizs()
|
||||
.find(filter).toArray()
|
||||
else quizs = await db.table.quizs()
|
||||
.find(filter).project(proj).toArray()
|
||||
quizs = await db.table.quizs().find(filter)
|
||||
if (proj !== null) quizs = await quizs.project(proj)
|
||||
quizs = await quizs.sort({ "_id": -1 }).toArray()
|
||||
|
||||
if (filters.parseToAccount === undefined)
|
||||
for (var i in quizs)
|
||||
if (quizs[i].from !== undefined)
|
||||
|
|
Loading…
Reference in New Issue