Fixe model for User and adding hasElopage to User Object.

This commit is contained in:
elweyn 2021-10-12 16:50:07 +02:00
parent 36e6a459a4
commit d3198b037e
2 changed files with 3 additions and 2 deletions

View File

@ -19,7 +19,7 @@ export class User {
this.pubkey = json.public_hex
this.language = json.language
this.publisherId = json.publisher_id
if (json.hasElopage) this.hasElopage = json.hasElopage
this.hasElopage = json.hasElopage
}
@Field(() => String)
@ -76,6 +76,6 @@ export class User {
@Field(() => KlickTipp)
klickTipp: KlickTipp
@Field(() => Boolean)
@Field(() => Boolean, { nullable: true })
hasElopage?: boolean
}

View File

@ -45,6 +45,7 @@ export class UserResolver {
value: encode(result.data.session_id, result.data.user.public_hex),
})
const user = new User(result.data.user)
user.hasElopage = result.data.hasElopage
// read additional settings from settings table
const userRepository = getCustomRepository(UserRepository)
const userEntity = await userRepository.findByPubkeyHex(user.pubkey)