Skip to content

Commit

Permalink
fix: account expiry clear (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Aug 7, 2023
1 parent c201a56 commit e26415e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/UserForm/getUserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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,
Expand All @@ -77,6 +79,7 @@ export const getUserData = ({
),
},

accountExpiry: updatedAccountExpiry,
email,
firstName,
surname,
Expand Down

0 comments on commit e26415e

Please sign in to comment.