From 88fdf9ab613b9e1687b0305fa3e5b92c68ec628b Mon Sep 17 00:00:00 2001 From: gandrieu Date: Tue, 30 Mar 2021 10:21:55 +0200 Subject: [PATCH 1/2] Allow for query parameters already present in the catalog URL Some users may wish to provide a URL to the catalog containing query parameters, for instance an authentification token. This modification allows to add page parameters without breaking the existing parameters. --- src/components/Catalog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Catalog.vue b/src/components/Catalog.vue index f6fba0eb0..46fdadb66 100644 --- a/src/components/Catalog.vue +++ b/src/components/Catalog.vue @@ -373,8 +373,9 @@ export default { } try { + let sep = `${externalItemsLink.href}`.match(/\?/) ? '&' : '?'; const rsp = await fetchUri( - `${externalItemsLink.href}?page=${this.currentItemPage}` + `${externalItemsLink.href}${sep}page=${this.currentItemPage}` ); if (!rsp.ok) { @@ -404,7 +405,7 @@ export default { return items.features.map((item, idx) => ({ item, to: `/item${p}/${this.slugify( - `${externalItemsLink.href}?page=${this.currentItemPage}#${idx}` + `${externalItemsLink.href}${sep}page=${this.currentItemPage}#${idx}` )}`, title: item.properties.title || item.id, dateAcquired: item.properties.datetime From 0f9fd35e74650f54b699756d9732c0bd41bac179 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sun, 11 Apr 2021 15:05:40 +0200 Subject: [PATCH 2/2] Update src/components/Catalog.vue --- src/components/Catalog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Catalog.vue b/src/components/Catalog.vue index 46fdadb66..de92dbd9f 100644 --- a/src/components/Catalog.vue +++ b/src/components/Catalog.vue @@ -373,7 +373,7 @@ export default { } try { - let sep = `${externalItemsLink.href}`.match(/\?/) ? '&' : '?'; + let sep = externalItemsLink.href.includes('?') ? '&' : '?'; const rsp = await fetchUri( `${externalItemsLink.href}${sep}page=${this.currentItemPage}` );