Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb-jnk committed Feb 5, 2024
1 parent 0eaa9a9 commit 40c8b09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ app.get('/api/teamDetail/:teamUniformName', tokenVerificationMiddleware, async (
}),
])

res.json({ teamInfo, teamUsers: teamUsers._embedded.users })
// TODO: Implement shared data tab
res.json({teamUsers: { teamInfo, teamUsers: teamUsers._embedded.users }})
} catch (error) {
next(error)
}
Expand Down
16 changes: 8 additions & 8 deletions src/pages/TeamDetail/TeamDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function TeamDetail() {
const { teamId } = useParams<{ teamId: string }>()

const prepTeamData = useCallback((response: TeamDetailData): TableData['data'] => {
return response[''].teamUsers.map((user) => ({
return response["teamUsers"].teamUsers.map((user) => ({
id: user?.principal_name,
navn: renderUsernameColumn(user),
gruppe: user.groups?.map((group) => getGroupType(group.uniform_name)).join(', '),
Expand Down Expand Up @@ -66,8 +66,8 @@ export default function TeamDetail() {
useEffect(() => {
if (!teamDetailData) return

const displayName = teamDetailData[''].teamInfo.display_name
teamDetailData[''].teamInfo.display_name = displayName
const displayName = teamDetailData["teamUsers"].teamInfo.display_name
teamDetailData["teamUsers"].teamInfo.display_name = displayName
setBreadcrumbTeamDetailDisplayName({ displayName })
}, [teamDetailData, setBreadcrumbTeamDetailDisplayName])

Expand Down Expand Up @@ -123,7 +123,7 @@ export default function TeamDetail() {
return (
<>
<Title size={2} className={pageLayoutStyles.tableTitle}>
Team
Teammedlemmer
</Title>
<Table columns={teamOverviewTableHeaderColumns} data={teamDetailTableData as TableData['data']} />
</>
Expand All @@ -133,15 +133,15 @@ export default function TeamDetail() {

return (
<PageLayout
title={teamDetailData ? teamDetailData[''].teamInfo.display_name : ''}
title={teamDetailData ? teamDetailData["teamUsers"].teamInfo.display_name : ''}
content={renderContent()}
description={
<div className={styles.userProfileDescription}>
<Text medium>{teamDetailData ? teamDetailData[''].teamInfo.uniform_name : ''}</Text>
<Text medium>{teamDetailData ? teamDetailData["teamUsers"].teamInfo.uniform_name : ''}</Text>
<Text medium>
{teamDetailData ? teamDetailData[''].teamInfo.manager.display_name.split(', ').reverse().join(' ') : ''}
{teamDetailData ? teamDetailData["teamUsers"].teamInfo.manager.display_name.split(', ').reverse().join(' ') : ''}
</Text>
<Text medium>{teamDetailData ? teamDetailData[''].teamInfo.section_name : ''}</Text>
<Text medium>{teamDetailData ? teamDetailData["teamUsers"].teamInfo.section_name : ''}</Text>
</div>
}
/>
Expand Down

0 comments on commit 40c8b09

Please sign in to comment.