Deploy to live #19
|
|
@ -70,6 +70,14 @@ const {
|
|||
}
|
||||
return base
|
||||
},
|
||||
browseFilterBy: () => {
|
||||
let base = `locale:=${locale.value}`
|
||||
if (activeBibleStudies.value.length > 0) {
|
||||
const ids = activeBibleStudies.value.map(bs => bs.id).join(',')
|
||||
base += ` && bible_study:=[${ids}]`
|
||||
}
|
||||
return base
|
||||
},
|
||||
isUnlocked: () => unlocked.value,
|
||||
pageSize: () => settings.pageSize,
|
||||
paginationType: () => settings.paginationType,
|
||||
|
|
@ -107,7 +115,9 @@ async function applyBibleStudyFilter() {
|
|||
queryBy: 'title',
|
||||
filterBy: `bible_study:=${val}`,
|
||||
perPage: 1,
|
||||
includeFields: 'bible_study,title'
|
||||
includeFields: 'bible_study,title',
|
||||
useCache: true,
|
||||
cacheTtl: 3600
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ export function useDocumentDetailFetch() {
|
|||
q: '*',
|
||||
queryBy: 'title',
|
||||
filterBy: `id:=${docId} && $${paragraphsCollection}(id: *)`,
|
||||
includeFields: `*, $${paragraphsCollection}(*)`
|
||||
includeFields: `*, $${paragraphsCollection}(*)`,
|
||||
useCache: true,
|
||||
cacheTtl: 3600
|
||||
}]
|
||||
}
|
||||
}, { signal })
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ export function useFilters() {
|
|||
queryBy: 'title',
|
||||
filterBy: `bible_study:=${val}`,
|
||||
perPage: 1,
|
||||
includeFields: 'bible_study,title'
|
||||
includeFields: 'bible_study,title',
|
||||
useCache: true,
|
||||
cacheTtl: 3600
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ export interface GroupedTypesenseSearchOptions {
|
|||
queryBy: string
|
||||
/** Reevaluado en cada request (p.ej. depende de `locale.value`). */
|
||||
filterBy: () => string
|
||||
browseFilterBy?: () => string
|
||||
/** Cuando devuelve false, se excluyen los documentos `private:=true`. */
|
||||
isUnlocked: () => boolean
|
||||
pageSize: () => number
|
||||
|
|
@ -341,9 +342,10 @@ export function useGroupedTypesenseSearch(options: GroupedTypesenseSearchOptions
|
|||
}
|
||||
|
||||
function browseFilterBy() {
|
||||
const base = options.browseFilterBy ? options.browseFilterBy() : options.filterBy()
|
||||
return options.isUnlocked()
|
||||
? options.filterBy()
|
||||
: `${options.filterBy()} && private:=false`
|
||||
? base
|
||||
: `${base} && private:=false`
|
||||
}
|
||||
|
||||
const runner = createAbortableRunner()
|
||||
|
|
|
|||
Loading…
Reference in New Issue