mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
30 lines
580 B
TypeScript
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[]
|
|
}
|