Skip to content

Commit

Permalink
Use getLocalisedName on the UserAudit comp
Browse files Browse the repository at this point in the history
Replace older logic to get the name which was based on an assumption that we support names in multiple languages

#6830
  • Loading branch information
Siyasanga committed Oct 24, 2024
1 parent a9d0747 commit 46b6c1d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/client/src/views/UserAudit/UserAudit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Frame } from '@opencrvs/components/lib/Frame'
import { IntlShape, useIntl } from 'react-intl'
import { useParams } from 'react-router'
import { GET_USER } from '@client/user/queries'
import { createNamesMap } from '@client/utils/data-formatting'
import { getLocalisedName } from '@client/utils/data-formatting'
import { AvatarSmall } from '@client/components/Avatar'
import styled from 'styled-components'
import { ToggleMenu } from '@opencrvs/components/lib/ToggleMenu'
Expand Down Expand Up @@ -83,9 +83,7 @@ const transformUserQueryResult = (
'')) ||
''
},
name:
createNamesMap(userData.name as HumanName[])[locale] ||
createNamesMap(userData.name as HumanName[])[LANG_EN],
name: getLocalisedName(intl, userData.name[0]),
systemRole: userData.systemRole,
role: userData.role,
number: userData.mobile,
Expand Down

0 comments on commit 46b6c1d

Please sign in to comment.