Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 0a6e856

Browse files
committed
fix teamkatalogen in search
1 parent 76d388a commit 0a6e856

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/search/resultList.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,13 @@ const ResultList = ({
9797
})
9898

9999
const getTeamKatalogenInfo = (item: any) => {
100-
const tk = teamkatalogen?.find((it) => it.url == item?.teamkatalogenURL)
100+
const getTeamID = (url: string) => {
101+
var urlComponents = url?.split("/")
102+
return urlComponents?.[urlComponents.length - 1]
103+
}
104+
const tk = teamkatalogen?.find((it) => getTeamID(it.url) == getTeamID(item?.owner?.teamkatalogenURL))
101105
const po = productAreas?.find((it) => it.id == tk?.productAreaID)
106+
102107
return {
103108
productArea: po?.name,
104109
teamkatalogenTeam: tk?.name || item.group?.group
@@ -117,6 +122,7 @@ const ResultList = ({
117122
(d) => d.result.__typename === 'Story'
118123
)
119124

125+
//dataproducts.forEach((d) => console.log(getTeamKatalogenInfo(d.result)?.teamkatalogenTeam))
120126
return (
121127
<Results>
122128
<Tabs

0 commit comments

Comments
 (0)