Skip to content
Snippets Groups Projects
Commit cecb26a8 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

activate numerical filters

parent 6f9d97c6
No related branches found
No related tags found
2 merge requests!203Foldseek pages,!186Refactor facet autocomplete
Pipeline #120034 passed with warnings with stages
in 7 minutes and 2 seconds
......@@ -7,7 +7,6 @@ import { useThrottleFn } from '@vueuse/core'
import type { FacetInputItem } from '@/components/AutocompleteMeiliFacets.vue'
import { useMeiliSearch } from "#imports"
// import { saveAs } from "file-saver";
import { useFileSystemAccess } from '@vueuse/core'
export interface SortItem {
key: string,
order: boolean | 'asc' | 'desc'
......@@ -151,9 +150,9 @@ const msFilter = computed(() => {
} else { return null }
})
const computedFilter = computed(() => {
console.log(toValue(msFilter))
if (msFilter.value !== null) {
return [toValue(msFilter), props.numericalFilters].filter(f => f !== undefined && f !== null).join(" AND ")
console.log(toValue(msFilterCompo))
if (msFilterCompo.value !== null) {
return [toValue(msFilterCompo), props.numericalFilters].filter(f => f !== undefined && f !== null).join(" AND ")
}
})
......@@ -187,7 +186,7 @@ async function searchOrFilter() {
loading.value = true
// const q = queryInputValue.value === null ? "" : queryInputValue.value
const q = search.value
await msSearch(q, { ...paginationParams.value, filter: toValue(msFilterCompo), sort: msSortBy.value })
await msSearch(q, { ...paginationParams.value, filter: toValue(computedFilter), sort: msSortBy.value })
} catch (error: any) {
filterError.value = error
console.log(error)
......@@ -203,7 +202,7 @@ function emitRefreshRes() {
emit("refresh:search", {
index: props.db,
query: q,
params: { ...notPaginatedParams.value, filter: toValue(msFilterCompo), sort: msSortBy.value }
params: { ...notPaginatedParams.value, filter: toValue(computedFilter), sort: msSortBy.value }
})
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment