{
@@ -764,7 +838,7 @@ export default {
this.getFacets(this.facets?.cache_key)
})
})
- },
+ }, 300),
openRandom: function () {
this.refreshData(true)
},
@@ -818,6 +892,9 @@ export default {
this.search.search_rating = filter?.rating ?? undefined
this.search.sort_order = filter?.options?.query?.sort_order ?? []
this.search.pagination_page = 1
+ this.search.timescooked = undefined
+ this.search.makenow = false
+ this.search.lastcooked = undefined
let fieldnum = {
keywords: 1,
@@ -916,6 +993,16 @@ export default {
if (rating !== undefined && !this.search.search_rating_gte) {
rating = rating * -1
}
+ let lastcooked = this.search.lastcooked || undefined
+ if (lastcooked !== undefined && !this.search.lastcooked_gte) {
+ lastcooked = "-" + lastcooked
+ }
+ let timescooked = parseInt(this.search.timescooked)
+ if (isNaN(timescooked)) {
+ timescooked = undefined
+ } else if (!this.search.timescooked_gte) {
+ timescooked = timescooked * -1
+ }
// when a filter is selected - added search params will be added to the filter
let params = {
options: { query: {} },
@@ -928,15 +1015,19 @@ export default {
internal: this.search.search_internal,
random: this.random_search,
_new: this.ui.sort_by_new,
+ timescooked: timescooked,
+ makenow: this.search.makenow || undefined,
+ lastcooked: lastcooked,
page: this.search.pagination_page,
pageSize: this.ui.page_size,
}
- params.options.query.sort_order = this.search.sort_order.map((x) => x.value)
+ params.options.query = {
+ sort_order: this.search.sort_order.map((x) => x.value),
+ }
if (!this.searchFiltered()) {
params.options.query.last_viewed = this.ui.recently_viewed
}
- console.log(params)
return params
},
searchFiltered: function (ignore_string = false) {
@@ -948,7 +1039,12 @@ export default {
this.random_search ||
this.search?.search_filter ||
this.search.sort_order.length !== 0 ||
- this.search?.search_rating !== undefined
+ this.search?.search_rating !== undefined ||
+ (this.search.timescooked !== undefined && this.search.timescooked !== "") ||
+ this.search.makenow !== false ||
+ (this.search.lastcooked !== undefined && this.search.lastcooked !== "")
+
+ console.log()
if (ignore_string) {
return filtered
@@ -1008,9 +1104,12 @@ export default {