From 661b3f9a22b0009a7d20d86c3913ae544e2eeee1 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Fri, 16 Sep 2022 12:04:25 -0300 Subject: [PATCH] [FIX]Update profile name (#4513) --- app/definitions/IProfile.ts | 3 ++- app/views/ProfileView/index.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/definitions/IProfile.ts b/app/definitions/IProfile.ts index f75885c09..d232672cb 100644 --- a/app/definitions/IProfile.ts +++ b/app/definitions/IProfile.ts @@ -1,7 +1,8 @@ import React from 'react'; export interface IProfileParams { - name: string; + realname?: string; + name?: string; username: string; email: string | null; newPassword: string; diff --git a/app/views/ProfileView/index.tsx b/app/views/ProfileView/index.tsx index c428a0d4e..f07e97ab2 100644 --- a/app/views/ProfileView/index.tsx +++ b/app/views/ProfileView/index.tsx @@ -226,7 +226,7 @@ class ProfileView extends React.Component // Name if (user.name !== name) { - params.name = name; + params.realname = name; } // Username @@ -295,6 +295,8 @@ class ProfileView extends React.Component if (result) { logEvent(events.PROFILE_SAVE_CHANGES); + params.name = params.realname; + delete params.realname; if (customFields) { dispatch(setUser({ customFields, ...params })); } else {