mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix lint
This commit is contained in:
parent
0640eb24d5
commit
3ecf960ab6
@ -47,20 +47,21 @@ export class UserResolver {
|
|||||||
const user = new User(result.data.user)
|
const user = new User(result.data.user)
|
||||||
// read additional settings from settings table
|
// read additional settings from settings table
|
||||||
const userRepository = getCustomRepository(UserRepository)
|
const userRepository = getCustomRepository(UserRepository)
|
||||||
let userEntity: void | DbUser = await userRepository.findByPubkeyHex(user.pubkey).catch(() => {})
|
let userEntity: void | DbUser
|
||||||
if(!userEntity) {
|
userEntity = await userRepository.findByPubkeyHex(user.pubkey).catch(() => {
|
||||||
// create user if it don't exist with this pubkey
|
userEntity = new DbUser()
|
||||||
userEntity = new DbUser
|
|
||||||
userEntity.firstName = user.firstName
|
userEntity.firstName = user.firstName
|
||||||
userEntity.lastName = user.lastName
|
userEntity.lastName = user.lastName
|
||||||
userEntity.username = user.username
|
userEntity.username = user.username
|
||||||
userEntity.email = user.email
|
userEntity.email = user.email
|
||||||
userEntity.pubkey = Buffer.from(fromHex(user.pubkey))
|
userEntity.pubkey = Buffer.from(fromHex(user.pubkey))
|
||||||
|
|
||||||
|
|
||||||
userEntity.save().catch(() => {
|
userEntity.save().catch(() => {
|
||||||
throw new Error('error by save userEntity')
|
throw new Error('error by save userEntity')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
if (!userEntity) {
|
||||||
|
throw new Error('error with cannot happen')
|
||||||
}
|
}
|
||||||
|
|
||||||
const userSettingRepository = getCustomRepository(UserSettingRepository)
|
const userSettingRepository = getCustomRepository(UserSettingRepository)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user