diff --git a/src/js/components/Scope/DatasetScopePicker.tsx b/src/js/components/Scope/DatasetScopePicker.tsx index c70bcc94..48b9ec5a 100644 --- a/src/js/components/Scope/DatasetScopePicker.tsx +++ b/src/js/components/Scope/DatasetScopePicker.tsx @@ -31,7 +31,7 @@ const DatasetScopePicker = ({ parentProject }: DatasetScopePickerProps) => { const showSelectProject = !selectedScope.fixedProject && parentProject.identifier != scopeObj.project; const parentProjectScope: DiscoveryScope = { project: parentProject.identifier }; - const projectURL = scopeToUrl(parentProjectScope, baseURL, `/${page}`); + const projectURL = scopeToUrl(parentProjectScope, baseURL, page); return ( diff --git a/src/js/utils/router.ts b/src/js/utils/router.ts index fb098e30..ab952439 100644 --- a/src/js/utils/router.ts +++ b/src/js/utils/router.ts @@ -52,11 +52,11 @@ export const validProjectDataset = (projects: Project[], unvalidatedScope: Disco export const scopeToUrl = (scope: DiscoveryScope, prefix: string = '', suffix: string = ''): string => { if (scope.project && scope.dataset) { - return `${prefix}/p/${scope.project}/d/${scope.dataset}${suffix}`; + return `${prefix}/p/${scope.project}/d/${scope.dataset}/${suffix}`; } else if (scope.project) { - return `${prefix}/p/${scope.project}${suffix}`; + return `${prefix}/p/${scope.project}/${suffix}`; } else { - return `${prefix}${suffix}`; + return `${prefix}/${suffix}`; } };