user-group

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

View File

@ -1,15 +1,13 @@
import { EntityRepository, Repository } from 'typeorm';
import { UserGroup } from '@/models/entities/user-group';
import { UserGroupJoinings } from '../index';
import { SchemaType } from '@/misc/schema';
export type PackedUserGroup = SchemaType<typeof packedUserGroupSchema>;
import { Packed } from '@/misc/schema';
@EntityRepository(UserGroup)
export class UserGroupRepository extends Repository<UserGroup> {
public async pack(
src: UserGroup['id'] | UserGroup,
): Promise<PackedUserGroup> {
): Promise<Packed<'UserGroup'>> {
const userGroup = typeof src === 'object' ? src : await this.findOneOrFail(src);
const users = await UserGroupJoinings.find({