diff --git a/frontend/src/app/data-service/[eid]/page.tsx b/frontend/src/app/data-service/[eid]/page.tsx index 1c8318f9e53dd1efedb407fc7fc776d9bf338435_ZnJvbnRlbmQvc3JjL2FwcC9kYXRhLXNlcnZpY2UvW2VpZF0vcGFnZS50c3g=..7e3a95822571fa487e566e20dd7261966dec96b9_ZnJvbnRlbmQvc3JjL2FwcC9kYXRhLXNlcnZpY2UvW2VpZF0vcGFnZS50c3g= 100644 --- a/frontend/src/app/data-service/[eid]/page.tsx +++ b/frontend/src/app/data-service/[eid]/page.tsx @@ -12,6 +12,7 @@ import { useState } from "react"; import { useRouter } from "next/navigation"; import { useGetDataService } from "@/hooks/useGetDataService"; +import { Project } from "@/types"; export default function DataService({ params: { eid }, @@ -44,6 +45,17 @@ return <ErrorScreen />; } + // get projects that use this dataservice at least once + // FIXME fix RQL to get projets only once juste + const uniqueProjs: Project[] = []; + const uniqueProjNames: string[] = []; + data.projects?.map((p) => { + if (!uniqueProjNames.includes(p.name)) { + uniqueProjs.push(p); + uniqueProjNames.push(p.name); + } + }); + return ( <Container> <BreadcrumbsMenu page="Data Service" /> @@ -62,7 +74,7 @@ </Typography> </Stack> <CardList loading={false} emptyText="Aucun projet"> - {data.projects?.map((p, i) => ( + {uniqueProjs?.map((p, i) => ( <ProjectCard key={i} name={p.name}