ENCOA-315: Small fix and merge

This commit is contained in:
Carlos-Mesquita
2025-01-22 05:24:49 +00:00
18 changed files with 1857 additions and 1044 deletions

View File

@@ -15,7 +15,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
const {user} = req.query;
const snapshot = await db.collection("stats").find({ user: user }).toArray();
const snapshot = await db.collection("stats").aggregate([
{ $match: { user: user } },
{ $sort: { "date": 1 } }
]).toArray();
res.status(200).json(snapshot);
}