From 161fd4afab323ca6bf491def473f84bb7557b481 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 7 Mar 2018 17:48:32 +0900 Subject: wip --- src/api/endpoints/othello/invitations.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/api/endpoints/othello/invitations.ts (limited to 'src/api/endpoints/othello/invitations.ts') diff --git a/src/api/endpoints/othello/invitations.ts b/src/api/endpoints/othello/invitations.ts new file mode 100644 index 0000000000..f462ef0bf9 --- /dev/null +++ b/src/api/endpoints/othello/invitations.ts @@ -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)))); +}); -- cgit v1.2.3-freya