52774bbe64
* wip * wip * wip * Update index.ts * Update gen-openapi-spec.ts * Update api.ja-JP.md * Fix * Improve doc * Update gen-openapi-spec.ts * Update redoc.html * Improve doc * Update gen-openapi-spec.ts * Improve doc * Update CHANGELOG.md
22 lines
449 B
TypeScript
22 lines
449 B
TypeScript
import Matching, { pack as packMatching } from '../../../../../models/games/reversi/matching';
|
|
import define from '../../../define';
|
|
|
|
export const meta = {
|
|
tags: ['games'],
|
|
|
|
requireCredential: true
|
|
};
|
|
|
|
export default define(meta, async (ps, user) => {
|
|
// Find session
|
|
const invitations = await Matching.find({
|
|
childId: user._id
|
|
}, {
|
|
sort: {
|
|
_id: -1
|
|
}
|
|
});
|
|
|
|
return await Promise.all(invitations.map((i) => packMatching(i, user)));
|
|
});
|