From 4aca2c10b0268fb6f3e61931094535b844afade5 Mon Sep 17 00:00:00 2001 From: lukewhchen Date: Tue, 12 Mar 2024 15:46:36 -0700 Subject: [PATCH] fix(*): logic --- .../src/composables/useFetchUrlBuilder.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/entities/entities-shared/src/composables/useFetchUrlBuilder.ts b/packages/entities/entities-shared/src/composables/useFetchUrlBuilder.ts index 2e8bf9a6ce..f7fb01f92f 100644 --- a/packages/entities/entities-shared/src/composables/useFetchUrlBuilder.ts +++ b/packages/entities/entities-shared/src/composables/useFetchUrlBuilder.ts @@ -13,7 +13,10 @@ export default function useFetchUrlBuilder( const _config = ref(unref(config)) const _baseUrl = ref(unref(baseUrl)) - const isExactMatch = computed((): boolean => !!_config.value.isExactMatch) + const isExactMatch = computed( + (): boolean => !!(_config.value.app === 'konnect' || _config.value.isExactMatch), + ) + // const isExactMatch = computed((): boolean => !!_config.value.isExactMatch) // Construct a URL object, adding the current `window.location.origin` if the path begins with a slash const baseRequestUrl = computed((): URL => @@ -31,13 +34,10 @@ export default function useFetchUrlBuilder( try { let urlWithParams: URL = new URL(baseRequestUrl.value.href) if (isExactMatch.value && query) { - // Using exact match - urlWithParams.search = '' // trim any query params - urlWithParams = new URL(`${urlWithParams.href}/${query}/`) - } else if (_config.value.app === 'konnect') { - // Konnect support filter param structure urlWithParams.search = '' // trim any query params - urlWithParams = new URL(`${urlWithParams.href}?filter[name][contains]=${query}`) + urlWithParams = _config.value.isExactMatch + ? new URL(`${urlWithParams.href}/${query}/`) + : new URL(`${urlWithParams.href}?filter[name][contains]=${query}`) } else { if (!isExactMatch.value) { // Using fuzzy match