Sort API me.quizs by DESC order

This commit is contained in:
Niko 2022-02-23 15:56:06 +01:00
parent f273506d9d
commit caffafa7fc
1 changed files with 4 additions and 5 deletions

View File

@ -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)