ohmyform-api/src/dto/profile/profile.model.ts
2020-05-31 23:19:40 +02:00

16 lines
368 B
TypeScript

import { Field, ObjectType } from '@nestjs/graphql';
import { UserDocument } from '../../schema/user.schema';
import { UserModel } from '../user/user.model';
@ObjectType('Profile')
export class ProfileModel extends UserModel {
@Field(() => [String])
readonly roles: string[]
constructor(user: UserDocument) {
super(user)
this.roles = user.roles
}
}