wip
This commit is contained in:
parent
7f0b9d933d
commit
a53874edc2
2 changed files with 9 additions and 1 deletions
|
@ -15,7 +15,11 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||||
} : {};
|
} : {};
|
||||||
|
|
||||||
// Fetch games
|
// Fetch games
|
||||||
const games = await Game.find(q);
|
const games = await Game.find(q, {
|
||||||
|
sort: {
|
||||||
|
_id: -1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Reponse
|
// Reponse
|
||||||
res(Promise.all(games.map(async (g) => await pack(g, user))));
|
res(Promise.all(games.map(async (g) => await pack(g, user))));
|
||||||
|
|
|
@ -4,6 +4,10 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||||
// Find session
|
// Find session
|
||||||
const invitations = await Matching.find({
|
const invitations = await Matching.find({
|
||||||
child_id: user._id
|
child_id: user._id
|
||||||
|
}, {
|
||||||
|
sort: {
|
||||||
|
_id: -1
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reponse
|
// Reponse
|
||||||
|
|
Loading…
Reference in a new issue