From 89addd0c90be53511cec452c606f7ad024e40279 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Tue, 26 Sep 2023 09:41:37 -0400 Subject: [PATCH] change query param name from cardSearchText to q --- app/institutions/discover/controller.ts | 6 +++--- app/preprints/discover/controller.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/institutions/discover/controller.ts b/app/institutions/discover/controller.ts index 574e67d4965..87ed3942d09 100644 --- a/app/institutions/discover/controller.ts +++ b/app/institutions/discover/controller.ts @@ -8,12 +8,12 @@ import { Filter, OnSearchParams, ResourceTypeFilterValue } from 'osf-components/ export default class InstitutionDiscoverController extends Controller { @service currentUser!: CurrentUser; - @tracked cardSearchText?: string = ''; + @tracked q?: string = ''; @tracked sort?: string = '-relevance'; @tracked resourceType?: ResourceTypeFilterValue | null = null; @tracked activeFilters?: Filter[] = []; - queryParams = ['cardSearchText', 'sort', 'resourceType', 'activeFilters']; + queryParams = ['q', 'sort', 'resourceType', 'activeFilters']; get defaultQueryOptions() { const identifiers = [this.model.rorIri, this.model.iri, this.model.links.html].filter(Boolean).join(','); @@ -24,7 +24,7 @@ export default class InstitutionDiscoverController extends Controller { @action onSearch(queryOptions: OnSearchParams) { - this.cardSearchText = queryOptions.cardSearchText; + this.q = queryOptions.cardSearchText; this.sort = queryOptions.sort; this.resourceType = queryOptions.resourceType; this.activeFilters = queryOptions.activeFilters; diff --git a/app/preprints/discover/controller.ts b/app/preprints/discover/controller.ts index d1f12f64e72..515a81eff10 100644 --- a/app/preprints/discover/controller.ts +++ b/app/preprints/discover/controller.ts @@ -14,11 +14,11 @@ export default class PreprintDiscoverController extends Controller { @service store!: Store; @service theme!: Theme; - @tracked cardSearchText?: string = ''; + @tracked q?: string = ''; @tracked sort?: string = '-relevance'; @tracked activeFilters?: Filter[] = []; - queryParams = ['cardSearchText', 'sort', 'activeFilters']; + queryParams = ['q', 'sort', 'activeFilters']; get defaultQueryOptions() { return { @@ -29,7 +29,7 @@ export default class PreprintDiscoverController extends Controller { @action onSearch(queryOptions: OnSearchParams) { - this.cardSearchText = queryOptions.cardSearchText; + this.q = queryOptions.cardSearchText; this.sort = queryOptions.sort; this.activeFilters = queryOptions.activeFilters; }