wip
This commit is contained in:
parent
6c495268ae
commit
161fd4afab
37 changed files with 747 additions and 219 deletions
11
src/api/endpoints/othello/invitations.ts
Normal file
11
src/api/endpoints/othello/invitations.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
});
|
||||
|
||||
// Reponse
|
||||
res(Promise.all(invitations.map(async (i) => await packMatching(i, user))));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue