user-list

This commit is contained in:
tamaina 2021-09-12 22:41:38 +09:00
parent 3eb79b23bc
commit c9926414a0
1 changed files with 2 additions and 4 deletions

View File

@ -1,15 +1,13 @@
import { EntityRepository, Repository } from 'typeorm';
import { UserList } from '@/models/entities/user-list';
import { UserListJoinings } from '../index';
import { SchemaType } from '@/misc/schema';
export type PackedUserList = SchemaType<typeof packedUserListSchema>;
import { Packed } from '@/misc/schema';
@EntityRepository(UserList)
export class UserListRepository extends Repository<UserList> {
public async pack(
src: UserList['id'] | UserList,
): Promise<PackedUserList> {
): Promise<Packed<'UserList'>> {
const userList = typeof src === 'object' ? src : await this.findOneOrFail(src);
const users = await UserListJoinings.find({