add userLocation in login-response

This commit is contained in:
clauspeterhuebner 2025-02-21 19:32:41 +01:00
parent 5d1caabf7a
commit 7a4fadea13
2 changed files with 19 additions and 1 deletions

View File

@ -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
}

View File

@ -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
}
}
`