blocking
This commit is contained in:
parent
b98687244d
commit
3d54fb24d5
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue