mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
add "isModerator" in graphql model
This commit is contained in:
parent
61a9f0a045
commit
35eef52aef
@ -1,3 +1,4 @@
|
||||
import { ROLE_NAMES } from '@/auth/ROLES'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
|
||||
@ -19,7 +20,17 @@ export class User {
|
||||
this.language = user.language
|
||||
this.publisherId = user.publisherId
|
||||
if (user.userRole) {
|
||||
this.isAdmin = user.userRole.createdAt
|
||||
switch (user.userRole.role) {
|
||||
case ROLE_NAMES.ROLE_NAME_ADMIN:
|
||||
this.isAdmin = user.userRole.createdAt
|
||||
break
|
||||
case ROLE_NAMES.ROLE_NAME_MODERATOR:
|
||||
this.isModerator = user.userRole.createdAt
|
||||
break
|
||||
default:
|
||||
this.isAdmin = null
|
||||
this.isModerator = null
|
||||
}
|
||||
}
|
||||
this.klickTipp = null
|
||||
this.hasElopage = null
|
||||
@ -67,6 +78,9 @@ export class User {
|
||||
@Field(() => Date, { nullable: true })
|
||||
isAdmin: Date | null
|
||||
|
||||
@Field(() => Date, { nullable: true })
|
||||
isModerator: Date | null
|
||||
|
||||
@Field(() => KlickTipp, { nullable: true })
|
||||
klickTipp: KlickTipp | null
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user