Refactor (#7394)
* wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts
This commit is contained in:
parent
62cc14c93b
commit
ce340aba7a
109 changed files with 252 additions and 201 deletions
|
|
@ -3,6 +3,7 @@ import { Users } from '..';
|
|||
import { Blocking } from '../entities/blocking';
|
||||
import { awaitAll } from '../../prelude/await-all';
|
||||
import { SchemaType } from '@/misc/schema';
|
||||
import { User } from '../entities/user';
|
||||
|
||||
export type PackedBlocking = SchemaType<typeof packedBlockingSchema>;
|
||||
|
||||
|
|
@ -10,7 +11,7 @@ export type PackedBlocking = SchemaType<typeof packedBlockingSchema>;
|
|||
export class BlockingRepository extends Repository<Blocking> {
|
||||
public async pack(
|
||||
src: Blocking['id'] | Blocking,
|
||||
me?: any
|
||||
me?: { id: User['id'] } | null | undefined
|
||||
): Promise<PackedBlocking> {
|
||||
const blocking = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ export class BlockingRepository extends Repository<Blocking> {
|
|||
|
||||
public packMany(
|
||||
blockings: any[],
|
||||
me: any
|
||||
me: { id: User['id'] }
|
||||
) {
|
||||
return Promise.all(blockings.map(x => this.pack(x, me)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue