Skip to content
Snippets Groups Projects
Commit f808852d authored by Julien MARGAIL's avatar Julien MARGAIL
Browse files

add OGS_EXPLORER_PATH for Data component

parent d04ebfa9
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@ interface Idata {
options?: any
}
const EXPLORER_PATH = process.env.OGS_EXPLORER_PATH || "/explorer"
const Data = (props: Idata) => {
const { title, action, anime, layout = "row", size = "xs" } = props
const options = props.options ?? {}
......@@ -24,10 +26,8 @@ const Data = (props: Idata) => {
const [data, setData] = useState<any[]>([])
const HOST = process.env.PF_URL || ""
useEffect(() => {
fetch(`${HOST}/fr/indexer/elastic/_search/?request_cache=true`, {
fetch("/fr/indexer/elastic/_search/?request_cache=true", {
method: "POST",
headers: new Headers({
"Content-Type": "application/json; charset=UTF-8",
......@@ -84,7 +84,7 @@ const Data = (props: Idata) => {
name: md.display_name,
description: md.description,
image: md.thumbnail,
url: `/portail/fr/jeux-de-donnees/${url}`,
url: `${EXPLORER_PATH}/fr/jeux-de-donnees/${url}`,
size: size,
// url: `/geoportal/#/context/Admin/${item.id}`,
anime: anime || options.anime,
......
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