This commit is contained in:
tamaina 2021-09-12 22:56:32 +09:00
parent b98687244d
commit 3d54fb24d5

View file

@ -2,17 +2,15 @@ import { EntityRepository, Repository } from 'typeorm';
import { Users } from '../index';
import { Blocking } from '@/models/entities/blocking';
import { awaitAll } from '@/prelude/await-all';
import { SchemaType } from '@/misc/schema';
import { Packed } from '@/misc/schema';
import { User } from '@/models/entities/user';
export type PackedBlocking = SchemaType<typeof packedBlockingSchema>;
@EntityRepository(Blocking)
export class BlockingRepository extends Repository<Blocking> {
public async pack(
src: Blocking['id'] | Blocking,
me?: { id: User['id'] } | null | undefined
): Promise<PackedBlocking> {
): Promise<Packed<'Blocking'>> {
const blocking = typeof src === 'object' ? src : await this.findOneOrFail(src);
return await awaitAll({