user-group
This commit is contained in:
parent
d7488715df
commit
3eb79b23bc
1 changed files with 2 additions and 4 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue