Skip to content

Commit

Permalink
fix(details): add createdBy, fallback to created if no lastUpdatedBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Nov 6, 2023
1 parent dead6f4 commit 7fd98e3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const defaultQueryFields = [
'id',
'shortName',
'href',
'createdBy',
] as const

const createDefaultDetailsQuery = (
Expand Down Expand Up @@ -87,11 +88,16 @@ const DetailsContent = ({ data }: { data: DetailsResponse }) => {
</DetailItem>
)}
<DetailItem label={i18n.t('Code')}>{data.code}</DetailItem>
<DetailItem label={i18n.t('Created by')}>
{data.createdBy.displayName}
</DetailItem>
<DetailItem label={i18n.t('Created')}>
<ClientDateTime value={data.created} />
</DetailItem>
<DetailItem label={i18n.t('Last updated by')}>
{data.lastUpdatedBy.displayName}
{data.lastUpdatedBy
? data.lastUpdatedBy.displayName
: data.createdBy.displayName}
</DetailItem>
<DetailItem label={i18n.t('Last updated')}>
<ClientDateTime value={data.lastUpdated} />
Expand Down

0 comments on commit 7fd98e3

Please sign in to comment.