This commit is contained in:
tamaina 2021-09-12 22:56:03 +09:00
parent fad785bebf
commit b98687244d
1 changed files with 2 additions and 4 deletions

View File

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