Refactorijg
This commit is contained in:
parent
2cdcbcc80e
commit
865fd25af1
19 changed files with 46 additions and 44 deletions
|
|
@ -1,16 +0,0 @@
|
|||
import Matching, { pack as packMatching } from '../../../../models/reversi-matching';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export default (params: any, user: ILocalUser) => 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))));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue