Claus-Peter Huebner 4beae51475 rework PR-comments
2023-07-11 18:50:51 +02:00

30 lines
580 B
TypeScript

import { User } from '@entity/User'
import { Field, Int, ObjectType } from 'type-graphql'
@ObjectType()
export class AdminUser {
constructor(user: User) {
this.firstName = user.firstName
this.lastName = user.lastName
this.role = user.userRoles.length > 0 ? user.userRoles[0].role : ''
}
@Field(() => String)
firstName: string
@Field(() => String)
lastName: string
@Field(() => String)
role: string
}
@ObjectType()
export class SearchAdminUsersResult {
@Field(() => Int)
userCount: number
@Field(() => [AdminUser])
userList: AdminUser[]
}