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

use ms client

parent a90ed519
No related branches found
No related tags found
No related merge requests found
Pipeline #127494 canceled
......@@ -266,14 +266,24 @@ watch(search, () => {
// })
async function downloadData() {
pendingDownloadData.value = true
try {
const { data } = await useAsyncMeiliSearch({
index: props.autocompleteMeiliFacetsProps.db,
params: { ...toValue(notPaginatedParams), filter: toValue(computedFilter), sort: toValue(msSortBy) },
query: toValue(search),
pendingDownloadData.value = true
const data = await client
.index(props.autocompleteMeiliFacetsProps.db)
.search(
toValue(search),
{
...toValue(notPaginatedParams), filter: toValue(computedFilter), sort: toValue(msSortBy)
})
// const { data } = await useAsyncMeiliSearch({
// index: props.autocompleteMeiliFacetsProps.db,
// params: { ...toValue(notPaginatedParams), filter: toValue(computedFilter), sort: toValue(msSortBy) },
// query: toValue(search),
// })
useCsvDownload(data, props.columnsToDownload, props.title)
} finally {
pendingDownloadData.value = false
......
......@@ -38,18 +38,6 @@ onMounted(async () => {
})
// onBeforeMount(async () => {
// const { data } = await useAsyncMeiliSearch({
// index: toValue(dbName), query: "", params: {
// facets: ["*"],
// filter: [],
// page: 1,
// hitsPerPage: 25,
// }
// })
// autocompleteMeiliFacetsProps.value.facetDistribution = toValue(data)?.facetDistribution
// })
const autocompleteMeiliFacetsProps = ref<AutocompleteMeiliFacetProps>({
db: toValue(dbName),
......
......@@ -5,31 +5,36 @@ const sortBy: Ref<SortItem[]> = ref([{ key: 'title', order: "asc" }])
const itemValue = ref("title");
const dbName = ref("systems")
onBeforeMount(async () => {
const { data } = await useAsyncMeiliSearch({
index: toValue(dbName), query: "", params: {
facets: ["*"],
filter: [],
page: 1,
hitsPerPage: 25,
}
})
const client = useMeiliSearchRef()
autocompleteMeiliFacetsProps.value.facetDistribution = toValue(data)?.facetDistribution
})
// onBeforeMount(async () => {
// const { data } = await useAsyncMeiliSearch({
// index: toValue(dbName), query: "", params: {
// facets: ["*"],
// filter: [],
// page: 1,
// hitsPerPage: 25,
// }
// })
// autocompleteMeiliFacetsProps.value.facetDistribution = toValue(data)?.facetDistribution
// })
onMounted(async () => {
const { data } = await useAsyncMeiliSearch({
index: toValue(dbName), query: "", params: {
try {
const data = await client
.index(toValue(dbName))
.search("", {
facets: ["*"],
filter: [],
page: 1,
hitsPerPage: 25,
}
})
autocompleteMeiliFacetsProps.value.facetDistribution = toValue(data)?.facetDistribution
autocompleteMeiliFacetsProps.value.facetDistribution = data?.facetDistribution
} catch (error) {
throw createError("Unable to get list of systems")
}
})
......@@ -123,7 +128,8 @@ const columnsToDownload = ref(['title', 'doi', 'Sensor', 'Activator', 'Effector'
</template>
<template #[`item.doi`]="{ item }">
<ArticleDoi v-if="item?.doi" :doi="item.doi" :abstract="item?.abstract" :divider="false" :enumerate="false" />
<ArticleDoi v-if="item?.doi" :doi="item.doi" :abstract="item?.abstract" :divider="false"
:enumerate="false" />
</template>
<template #[`item.PFAM`]="{ item }">
<pfam-chips v-if="item?.PFAM" :pfams="item.PFAM"></pfam-chips>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment