reversi 💮 💯
This commit is contained in:
15
src/server/api/endpoints/reversi/invitations.ts
Normal file
15
src/server/api/endpoints/reversi/invitations.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import Matching, { pack as packMatching } from '../../../../models/reversi-matching';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Find session
|
||||
const invitations = await Matching.find({
|
||||
childId: user._id
|
||||
}, {
|
||||
sort: {
|
||||
_id: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Reponse
|
||||
res(Promise.all(invitations.map(async (i) => await packMatching(i, user))));
|
||||
});
|
Reference in New Issue
Block a user