Skip to content

Commit

Permalink
fix(fiche-donnée): erreur de condition de recherche endpoint metadata #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Sep 23, 2024
1 parent bc501a9 commit a9d1724
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ const MetadataTab: FC<MetadataTabProps> = ({ datastoreId, datasheet, metadataQue
);

const catalogueDatasheetUrl = useMemo(() => {
const metadataEndpoint = datastoreQuery.data?.endpoints?.find((ep) => ep.endpoint._id === metadata?.endpoints?.[0]._id);
const cswBaseUrl = metadataEndpoint?.endpoint.urls?.[0].url.trim();

// si datastore sandbox
if (datastoreQuery.data?.is_sandbox === true) {
const metadataEndpoint = datastoreQuery.data?.endpoints?.find((ep) => ep.endpoint._id === metadata?.endpoints?.[0]?._id);
const cswBaseUrl = metadataEndpoint?.endpoint.urls?.[0].url.trim();

if (cswBaseUrl !== undefined) {
return `${cswBaseUrl}?REQUEST=GetRecordById&SERVICE=CSW&VERSION=2.0.2&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&elementSetName=full&ID=${metadata?.file_identifier}`;
}
Expand Down

0 comments on commit a9d1724

Please sign in to comment.