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)
|
@Field(() => String)
|
||||||
email!: string
|
email!: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
firstName?: string
|
firstName?: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
lastName?: string
|
lastName?: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
|
description?: string
|
||||||
|
|
||||||
|
@Field({ nullable: true })
|
||||||
username?: string
|
username?: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
language?: string
|
language?: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
password?: string
|
password?: string
|
||||||
|
|
||||||
@Field(() => String)
|
@Field({ nullable: true })
|
||||||
passwordNew?: string
|
passwordNew?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -137,24 +137,26 @@ export class UserResolver {
|
|||||||
{
|
{
|
||||||
sessionId,
|
sessionId,
|
||||||
email,
|
email,
|
||||||
firstName = '',
|
firstName,
|
||||||
lastName = '',
|
lastName,
|
||||||
username = '',
|
description,
|
||||||
language = '',
|
username,
|
||||||
password = '',
|
language,
|
||||||
passwordNew = '',
|
password,
|
||||||
|
passwordNew,
|
||||||
}: UpdateUserInfosArgs,
|
}: UpdateUserInfosArgs,
|
||||||
): Promise<UpdateUserInfosResponse> {
|
): Promise<UpdateUserInfosResponse> {
|
||||||
const payload = {
|
const payload = {
|
||||||
session_id: sessionId,
|
session_id: sessionId,
|
||||||
email,
|
email,
|
||||||
update: {
|
update: {
|
||||||
'User.first_name': firstName !== '' ? firstName : undefined,
|
'User.first_name': firstName || undefined,
|
||||||
'User.last_name': lastName !== '' ? lastName : undefined,
|
'User.last_name': lastName || undefined,
|
||||||
'User.username': username !== '' ? username : undefined,
|
'User.description': description || undefined,
|
||||||
'User.language': language !== '' ? language : undefined,
|
'User.username': username || undefined,
|
||||||
'User.password': passwordNew !== '' ? passwordNew : undefined,
|
'User.language': language || undefined,
|
||||||
'User.password_old': password !== '' ? password : undefined,
|
'User.password': passwordNew || undefined,
|
||||||
|
'User.password_old': password || undefined,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
|
const result = await apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user