From c0d30d0964b8f67d7732c046dc5895d94d21b702 Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Fri, 8 Nov 2024 11:17:30 +0100 Subject: [PATCH] fix(pat contentbrowser): fix wrong vocabularyUrl lookup when `@@getSource` view is used. --- src/pat/contentbrowser/src/App.svelte | 2 +- src/pat/contentbrowser/src/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pat/contentbrowser/src/App.svelte b/src/pat/contentbrowser/src/App.svelte index 33dbebe12..c07492bc3 100644 --- a/src/pat/contentbrowser/src/App.svelte +++ b/src/pat/contentbrowser/src/App.svelte @@ -56,7 +56,7 @@ } else { // no path available. try to determine path from vocabularyUrl const vocabPath = new URL(vocabularyUrl).pathname.split("/"); - rootPath = contextPath = $currentPath = vocabPath.slice(0, vocabPath.length - 1).join("/"); + rootPath = contextPath = $currentPath = vocabPath.slice(0, vocabPath.length - 1).join("/") || "/"; } } diff --git a/src/pat/contentbrowser/src/utils.js b/src/pat/contentbrowser/src/utils.js index 395af9861..f62698471 100644 --- a/src/pat/contentbrowser/src/utils.js +++ b/src/pat/contentbrowser/src/utils.js @@ -88,7 +88,7 @@ export async function request({ } }; - let url = `${vocabularyUrl}&query=${JSON.stringify( + let url = `${vocabularyUrl}${vocabularyUrl.indexOf("?") !== -1 ? "&" : "?"}query=${JSON.stringify( vocabQuery )}&attributes=${JSON.stringify(attributes)}&batch=${JSON.stringify({ page: page,