diff --git a/api/src/api/me.js b/api/src/api/me.js index ef1d463..c3976d4 100644 --- a/api/src/api/me.js +++ b/api/src/api/me.js @@ -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)