From 5026d932ae541880783e61f7827459b94d378e4c Mon Sep 17 00:00:00 2001 From: steveoni Date: Fri, 15 Dec 2023 20:00:06 +0100 Subject: [PATCH] replace slash in url --- components/dataset/DataExplorer.tsx | 4 ++-- components/resource/About.tsx | 2 +- pages/[org]/[dataset]/r/[resource]/index.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/dataset/DataExplorer.tsx b/components/dataset/DataExplorer.tsx index 9305462..0ce0c93 100644 --- a/components/dataset/DataExplorer.tsx +++ b/components/dataset/DataExplorer.tsx @@ -198,12 +198,12 @@ const DataExplorer: React.FC<{
diff --git a/components/resource/About.tsx b/components/resource/About.tsx index 63aff74..4ccd9f5 100644 --- a/components/resource/About.tsx +++ b/components/resource/About.tsx @@ -21,7 +21,7 @@ const About: React.FC<{ variables: any }> = ({ variables }) => { const { result } = data.dataset; // Find right resource const resource = result.resources.find( - (item) => item.name === variables.resource + (item) => item.name.replace(/\//g, '_') === variables.resource ); if (!resource?.id) diff --git a/pages/[org]/[dataset]/r/[resource]/index.tsx b/pages/[org]/[dataset]/r/[resource]/index.tsx index ffca87c..379b839 100644 --- a/pages/[org]/[dataset]/r/[resource]/index.tsx +++ b/pages/[org]/[dataset]/r/[resource]/index.tsx @@ -32,7 +32,7 @@ const Resource: React.FC<{ variables: any }> = ({ variables }) => { const { result } = data.dataset; // Find right resource const resource = result.resources.find( - (item) => item.name === variables.resource + (item) => item.name.replace(/\//g, '_') === variables.resource ); if (!resource) return ;