Skip to content
Snippets Groups Projects
Commit 7e3a95822571 authored by Olivier Giorgis's avatar Olivier Giorgis
Browse files

fix: display only once projects that use the dataservice in several of these recipes

parent 1c8318f9e53d
No related branches found
No related tags found
1 merge request!22Export data into SPARQL endpoint
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
import { useState } from "react"; import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { useGetDataService } from "@/hooks/useGetDataService"; import { useGetDataService } from "@/hooks/useGetDataService";
import { Project } from "@/types";
export default function DataService({ export default function DataService({
params: { eid }, params: { eid },
...@@ -44,6 +45,17 @@ ...@@ -44,6 +45,17 @@
return <ErrorScreen />; 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 ( return (
<Container> <Container>
<BreadcrumbsMenu page="Data Service" /> <BreadcrumbsMenu page="Data Service" />
...@@ -62,7 +74,7 @@ ...@@ -62,7 +74,7 @@
</Typography> </Typography>
</Stack> </Stack>
<CardList loading={false} emptyText="Aucun projet"> <CardList loading={false} emptyText="Aucun projet">
{data.projects?.map((p, i) => ( {uniqueProjs?.map((p, i) => (
<ProjectCard <ProjectCard
key={i} key={i}
name={p.name} name={p.name}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment