mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
reverse todos in lists
This commit is contained in:
@@ -15,7 +15,7 @@ router.get(
|
|||||||
const lists = await TodoList.find({ user: req.user.id })
|
const lists = await TodoList.find({ user: req.user.id })
|
||||||
.populate('todos')
|
.populate('todos')
|
||||||
.exec();
|
.exec();
|
||||||
res.json({ success: true, data: lists.map(list => list.toJson()) });
|
res.json({ success: true, data: lists.map(list => { list.todos.reverse(); list.toJson() }) });
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user