From 43cfeb9fbfad24f232f7fa6955a2e8de8ac8cf96 Mon Sep 17 00:00:00 2001 From: Mihoub Date: Mon, 28 Oct 2024 11:04:33 +0100 Subject: [PATCH] fix(production): update production url to scanr --- .../link-publications/external-links.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/pages/api-operation-page/link-publications/external-links.tsx b/client/src/pages/api-operation-page/link-publications/external-links.tsx index 8a4a81c..93274f7 100644 --- a/client/src/pages/api-operation-page/link-publications/external-links.tsx +++ b/client/src/pages/api-operation-page/link-publications/external-links.tsx @@ -8,6 +8,12 @@ export const ExternalLinks = ({ productionId, name }) => { const [scanRClicked, setScanRClicked] = useState(false); const [landingPageClicked, setLandingPageClicked] = useState(false); const { landingPage } = LandingPage(productionId); + + const scanRPath = + formattedProductionId.length >= 7 && formattedProductionId.length <= 9 + ? "patents" + : "publications"; + return ( <> { }`} target="_blank" rel="noreferrer noopener external" - href={`https://scanr.enseignementsup-recherche.gouv.fr/publications/${formattedProductionId}`} + href={`https://scanr.enseignementsup-recherche.gouv.fr/${scanRPath}/${formattedProductionId}`} onClick={() => setScanRClicked(true)} > scanR @@ -34,7 +40,6 @@ export const ExternalLinks = ({ productionId, name }) => { Editeur )} -