mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
add userLocation in login-response
This commit is contained in:
parent
5d1caabf7a
commit
7a4fadea13
@ -1,10 +1,14 @@
|
||||
import { Point } from '@dbTools/typeorm'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
import { ObjectType, Field, Int } from 'type-graphql'
|
||||
|
||||
import { GmsPublishLocationType } from '@enum/GmsPublishLocationType'
|
||||
import { PublishNameType } from '@enum/PublishNameType'
|
||||
|
||||
import { Point2Location } from '@/graphql/resolver/util/Location2Point'
|
||||
|
||||
import { KlickTipp } from './KlickTipp'
|
||||
import { Location } from './Location'
|
||||
|
||||
@ObjectType()
|
||||
export class User {
|
||||
@ -37,6 +41,8 @@ export class User {
|
||||
this.gmsPublishName = user.gmsPublishName
|
||||
this.humhubPublishName = user.humhubPublishName
|
||||
this.gmsPublishLocation = user.gmsPublishLocation
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
this.userLocation = user.location ? Point2Location(user.location as Point) : null
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,4 +115,7 @@ export class User {
|
||||
|
||||
@Field(() => [String])
|
||||
roles: string[]
|
||||
|
||||
@Field(() => Location, { nullable: true })
|
||||
userLocation: Location | null
|
||||
}
|
||||
|
||||
@ -343,16 +343,25 @@ export const redeemTransactionLink = gql`
|
||||
export const login = gql`
|
||||
mutation ($email: String!, $password: String!, $publisherId: Int) {
|
||||
login(email: $email, password: $password, publisherId: $publisherId) {
|
||||
id
|
||||
gradidoID
|
||||
alias
|
||||
firstName
|
||||
lastName
|
||||
language
|
||||
klickTipp {
|
||||
newsletterState
|
||||
}
|
||||
gmsAllowed
|
||||
humhubAllowed
|
||||
gmsPublishName
|
||||
humhubPublishName
|
||||
gmsPublishLocation
|
||||
userLocation
|
||||
hasElopage
|
||||
publisherId
|
||||
roles
|
||||
hideAmountGDD
|
||||
hideAmountGDT
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user