reversi-matching
This commit is contained in:
parent
6b72d888f8
commit
f8df218bbb
|
@ -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({
|
||||||
|
|
Loading…
Reference in New Issue