From afaa235c75728518336eb1ffdc977e83e51387d3 Mon Sep 17 00:00:00 2001 From: stairman06 <36215135+stairman06@users.noreply.github.com> Date: Mon, 23 May 2022 23:37:56 -0500 Subject: [PATCH] Save OR facets in query string (#486) * Save OR Facets * revert back to staging --- pages/search.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pages/search.vue b/pages/search.vue index 5145b33e4..035186228 100644 --- a/pages/search.vue +++ b/pages/search.vue @@ -337,6 +337,11 @@ export default { for (const facet of facets) await this.toggleFacet(facet, true) } + if (this.$route.query.g) { + const orFacets = this.$route.query.g.split(',') + + for (const orFacet of orFacets) await this.toggleOrFacet(orFacet, true) + } if (this.$route.query.v) this.selectedVersions = this.$route.query.v.split(',') if (this.$route.query.l) @@ -586,6 +591,8 @@ export default { if (offset > 0) queryItems.push(`o=${offset}`) if (this.facets.length > 0) queryItems.push(`f=${encodeURIComponent(this.facets)}`) + if (this.orFacets.length > 0) + queryItems.push(`g=${encodeURIComponent(this.orFacets)}`) if (this.selectedVersions.length > 0) queryItems.push(`v=${encodeURIComponent(this.selectedVersions)}`) if (this.selectedLicenses.length > 0)