Introduce processor
This commit is contained in:
parent
68ce6d5748
commit
90f8fe7e53
582 changed files with 246 additions and 188 deletions
15
src/server/api/endpoints/othello/invitations.ts
Normal file
15
src/server/api/endpoints/othello/invitations.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Matching, { pack as packMatching } from '../../models/othello-matching';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Find session
|
||||
const invitations = await Matching.find({
|
||||
child_id: user._id
|
||||
}, {
|
||||
sort: {
|
||||
_id: -1
|
||||
}
|
||||
});
|
||||
|
||||
// Reponse
|
||||
res(Promise.all(invitations.map(async (i) => await packMatching(i, user))));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue