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 Nov 14, 2024
1 parent a563c5a commit 347999c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 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 All @@ -42,7 +42,6 @@ import { UserAuditActionModal } from '@client/views/SysAdmin/Team/user/UserAudit
import {
GetUserQuery,
GetUserQueryVariables,
HumanName,
User,
SystemRoleType
} from '@client/utils/gateway'
Expand Down Expand Up @@ -83,9 +82,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 347999c

Please sign in to comment.