mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix update user infos
This commit is contained in:
parent
800e4e04fd
commit
729aa02035
@ -82,22 +82,25 @@ export class UpdateUserInfosArgs {
|
||||
@Field(() => String)
|
||||
email!: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
firstName?: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
lastName?: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
description?: string
|
||||
|
||||
@Field({ nullable: true })
|
||||
username?: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
language?: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
password?: string
|
||||
|
||||
@Field(() => String)
|
||||
@Field({ nullable: true })
|
||||
passwordNew?: string
|
||||
}
|
||||
|
||||
|
||||
@ -137,24 +137,26 @@ export class UserResolver {
|
||||
{
|
||||
sessionId,
|
||||
email,
|
||||
firstName = '',
|
||||
lastName = '',
|
||||
username = '',
|
||||
language = '',
|
||||
password = '',
|
||||
passwordNew = '',
|
||||
firstName,
|
||||
lastName,
|
||||
description,
|
||||
username,
|
||||
language,
|
||||
password,
|
||||
passwordNew,
|
||||
}: UpdateUserInfosArgs,
|
||||
): Promise<UpdateUserInfosResponse> {
|
||||
const payload = {
|
||||
session_id: sessionId,
|
||||
email,
|
||||
update: {
|
||||
'User.first_name': firstName !== '' ? firstName : undefined,
|
||||
'User.last_name': lastName !== '' ? lastName : undefined,
|
||||
'User.username': username !== '' ? username : undefined,
|
||||
'User.language': language !== '' ? language : undefined,
|
||||
'User.password': passwordNew !== '' ? passwordNew : undefined,
|
||||
'User.password_old': password !== '' ? password : undefined,
|
||||
'User.first_name': firstName || undefined,
|
||||
'User.last_name': lastName || undefined,
|
||||
'User.description': description || undefined,
|
||||
'User.username': username || undefined,
|
||||
'User.language': language || undefined,
|
||||
'User.password': passwordNew || undefined,
|
||||
'User.password_old': password || undefined,
|
||||
},
|
||||
}
|
||||
const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user