reversi-matching

This commit is contained in:
tamaina 2021-09-12 23:09:17 +09:00
parent 6b72d888f8
commit f8df218bbb

View file

@ -3,16 +3,14 @@ import { ReversiMatching } from '@/models/entities/games/reversi/matching';
import { Users } from '../../../index'; import { Users } from '../../../index';
import { awaitAll } from '@/prelude/await-all'; import { awaitAll } from '@/prelude/await-all';
import { User } from '@/models/entities/user'; import { User } from '@/models/entities/user';
import { SchemaType } from '@/misc/schema'; import { Packed } from '@/misc/schema';
export type PackedReversiMatching = SchemaType<typeof packedReversiMatchingSchema>;
@EntityRepository(ReversiMatching) @EntityRepository(ReversiMatching)
export class ReversiMatchingRepository extends Repository<ReversiMatching> { export class ReversiMatchingRepository extends Repository<ReversiMatching> {
public async pack( public async pack(
src: ReversiMatching['id'] | ReversiMatching, src: ReversiMatching['id'] | ReversiMatching,
me: { id: User['id'] } me: { id: User['id'] }
): Promise<PackedReversiMatching> { ): Promise<Packed<'ReversiMatching'>> {
const matching = typeof src === 'object' ? src : await this.findOneOrFail(src); const matching = typeof src === 'object' ? src : await this.findOneOrFail(src);
return await awaitAll({ return await awaitAll({