mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
concept for custom filter conversion, continue later
This commit is contained in:
@@ -486,15 +486,19 @@ function customFilterToApiRecipeListRequest(customFilterParams: any) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiRecipeListRequestToCustomFilter() {
|
/**
|
||||||
|
* convert filters to custom filter format
|
||||||
|
*/
|
||||||
|
// TODO unchanged for backward compatability for now, change to something easier to use later
|
||||||
|
function filtersToCustomFilterFormat() {
|
||||||
let customFilterParams: any = {};
|
let customFilterParams: any = {};
|
||||||
|
|
||||||
if (urlSearchParams['books'] != null) {
|
if (!isFilterDefaultValue(filters.value.books)) {
|
||||||
customFilterParams['books'] = urlSearchParams['books'];
|
customFilterParams['books'] = filters.value.books.modelValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urlSearchParams['booksAnd'] != null) {
|
if (!isFilterDefaultValue(filters.value.booksAnd)) {
|
||||||
customFilterParams['books_and'] = urlSearchParams['booksAnd'];
|
customFilterParams['books_and'] = filters.value.booksAnd.modelValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urlSearchParams['booksAndNot'] != null) {
|
if (urlSearchParams['booksAndNot'] != null) {
|
||||||
@@ -806,8 +810,7 @@ const filters = ref({
|
|||||||
default: "false",
|
default: "false",
|
||||||
is: VSelect,
|
is: VSelect,
|
||||||
items: [{value: "true", title: 'Yes'}, {value: "false", title: 'No'}],
|
items: [{value: "true", title: 'Yes'}, {value: "false", title: 'No'}],
|
||||||
modelValue: useRouteQuery('internal', "false"),
|
modelValue: useRouteQuery('internal', "false")
|
||||||
},
|
|
||||||
rating: {
|
rating: {
|
||||||
id: 'rating',
|
id: 'rating',
|
||||||
label: 'Rating (exact)',
|
label: 'Rating (exact)',
|
||||||
|
|||||||
Reference in New Issue
Block a user