mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 14:30:39 +01:00
blocking
This commit is contained in:
parent
b98687244d
commit
3d54fb24d5
1 changed files with 2 additions and 4 deletions
|
@ -2,17 +2,15 @@ import { EntityRepository, Repository } from 'typeorm';
|
||||||
import { Users } from '../index';
|
import { Users } from '../index';
|
||||||
import { Blocking } from '@/models/entities/blocking';
|
import { Blocking } from '@/models/entities/blocking';
|
||||||
import { awaitAll } from '@/prelude/await-all';
|
import { awaitAll } from '@/prelude/await-all';
|
||||||
import { SchemaType } from '@/misc/schema';
|
import { Packed } from '@/misc/schema';
|
||||||
import { User } from '@/models/entities/user';
|
import { User } from '@/models/entities/user';
|
||||||
|
|
||||||
export type PackedBlocking = SchemaType<typeof packedBlockingSchema>;
|
|
||||||
|
|
||||||
@EntityRepository(Blocking)
|
@EntityRepository(Blocking)
|
||||||
export class BlockingRepository extends Repository<Blocking> {
|
export class BlockingRepository extends Repository<Blocking> {
|
||||||
public async pack(
|
public async pack(
|
||||||
src: Blocking['id'] | Blocking,
|
src: Blocking['id'] | Blocking,
|
||||||
me?: { id: User['id'] } | null | undefined
|
me?: { id: User['id'] } | null | undefined
|
||||||
): Promise<PackedBlocking> {
|
): Promise<Packed<'Blocking'>> {
|
||||||
const blocking = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
const blocking = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||||
|
|
||||||
return await awaitAll({
|
return await awaitAll({
|
||||||
|
|
Loading…
Reference in a new issue