From 40c8b0973cd0b3715f42bf0c17537c72dbac5fde Mon Sep 17 00:00:00 2001 From: ssb-jnk Date: Mon, 5 Feb 2024 10:16:02 +0100 Subject: [PATCH] . --- server.js | 3 ++- src/pages/TeamDetail/TeamDetail.tsx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/server.js b/server.js index 37205397..1f6faa5a 100644 --- a/server.js +++ b/server.js @@ -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) } diff --git a/src/pages/TeamDetail/TeamDetail.tsx b/src/pages/TeamDetail/TeamDetail.tsx index fca11316..dfcb8535 100644 --- a/src/pages/TeamDetail/TeamDetail.tsx +++ b/src/pages/TeamDetail/TeamDetail.tsx @@ -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(', '), @@ -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]) @@ -123,7 +123,7 @@ export default function TeamDetail() { return ( <> - Team + Teammedlemmer @@ -133,15 +133,15 @@ export default function TeamDetail() { return ( - {teamDetailData ? teamDetailData[''].teamInfo.uniform_name : ''} + {teamDetailData ? teamDetailData["teamUsers"].teamInfo.uniform_name : ''} - {teamDetailData ? teamDetailData[''].teamInfo.manager.display_name.split(', ').reverse().join(' ') : ''} + {teamDetailData ? teamDetailData["teamUsers"].teamInfo.manager.display_name.split(', ').reverse().join(' ') : ''} - {teamDetailData ? teamDetailData[''].teamInfo.section_name : ''} + {teamDetailData ? teamDetailData["teamUsers"].teamInfo.section_name : ''} } />