Skip to content

Commit

Permalink
fix(Dashboard): incorrect projects map
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Jan 31, 2023
1 parent 91ee227 commit 756a8e1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/pages/goals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const fetcher = createFetcher((_, priority = [], states = [], query = '', tags =
id: true,
key: true,
title: true,
flowId: true,
teams: {
id: true,
title: true,
Expand Down Expand Up @@ -166,11 +167,13 @@ const GoalsPage = ({ user, ssrTime, locale, ssrData }: ExternalPageProps<{ userG
const usersData = new Map();

goals.forEach((g) => {
usersData.set(g?.owner?.id, g?.owner);
projectsData.set(g.project?.id, {
id: g.project?.id,
tittle: g.project?.title,
});
g?.owner?.id && usersData.set(g?.owner?.id, g?.owner);
g.project?.id &&
projectsData.set(g.project?.id, {
id: g.project?.id,
title: g.project?.title,
flowId: g.project?.flowId,
});
g?.tags?.forEach((t) => tagsData.set(t?.id, t));
});

Expand Down Expand Up @@ -245,7 +248,7 @@ const GoalsPage = ({ user, ssrTime, locale, ssrData }: ExternalPageProps<{ userG

<FiltersPanel
count={goalsCount}
flowId={projectsData[0]?.flowId}
flowId={Array.from(projectsData.values())[0]?.flowId}
users={usersFilterData}
tags={tagsFilterData}
priorityFilter={priorityFilter}
Expand Down

0 comments on commit 756a8e1

Please sign in to comment.