From e26415e6393991a9a8403a9bcf19cf81fdefed35 Mon Sep 17 00:00:00 2001 From: Thomas Zemp Date: Mon, 7 Aug 2023 11:42:48 +0200 Subject: [PATCH] fix: account expiry clear (#1263) --- src/components/UserForm/getUserData.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/UserForm/getUserData.js b/src/components/UserForm/getUserData.js index 4183a29d2..00703f9db 100644 --- a/src/components/UserForm/getUserData.js +++ b/src/components/UserForm/getUserData.js @@ -43,6 +43,12 @@ export const getUserData = ({ ) ) + // See https://jira.dhis2.org/browse/DHIS2-10569 + const updatedAccountExpiry = + typeof accountExpiry === 'string' && accountExpiry !== '' + ? accountExpiry + : undefined + return { // Because the data object is used as the payload of a PUT request, // properties that are omitted will be removed. To prevent this, all @@ -60,11 +66,7 @@ export const getUserData = ({ !inviteUser && !externalAuth && (!user || changePassword) ? password : undefined, - // See https://jira.dhis2.org/browse/DHIS2-10569 - accountExpiry: - typeof accountExpiry === 'string' && accountExpiry !== '' - ? accountExpiry - : undefined, + accountExpiry: updatedAccountExpiry, openId, ldapId, externalAuth, @@ -77,6 +79,7 @@ export const getUserData = ({ ), }, + accountExpiry: updatedAccountExpiry, email, firstName, surname,