import define from '../../../define';
import { ReversiMatchings } from '../../../../../models';
export const meta = {
tags: ['games'],
requireCredential: true as const,
res: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'object' as const,
properties: {
id: {
type: 'string' as const,
format: 'id'
},
createdAt: {
format: 'date-time'
parentId: {
parent: {
ref: 'User'
childId: {
child: {
}
};
export default define(meta, async (ps, user) => {
// Find session
const invitations = await ReversiMatchings.find({
childId: user.id
});
return await Promise.all(invitations.map((i) => ReversiMatchings.pack(i, user)));