Update: User.history missing sort by watchedDate

This commit is contained in:
Yûki VACHOT 2021-12-13 23:17:48 +01:00
parent 7dc6b64a3c
commit c465b87b3f

View file

@ -457,7 +457,8 @@ exports.history = (req, res) => {
watchedDate: {$arrayElemAt: ["$watchedDates", -1]},
createdAt: true,
updatedAt: true
}}])
}},
{$sort: {watchedDate: -1}}])
.then(async data => {
let yt_results = [];
let dm_results = [];