From d0549bcb6d07c34659474b5a87cd7c7d64bf6d37 Mon Sep 17 00:00:00 2001 From: Chris Scoggins Date: Thu, 20 Jan 2022 15:58:58 -0600 Subject: [PATCH] complex book filters --- cookbook/helper/recipe_search.py | 41 +++++-- cookbook/views/api.py | 21 ++-- .../RecipeSearchView/RecipeSearchView.vue | 64 +++++++--- vue/src/utils/models.js | 5 +- vue/src/utils/openapi/api.ts | 110 +++++++++++------- 5 files changed, 160 insertions(+), 81 deletions(-) diff --git a/cookbook/helper/recipe_search.py b/cookbook/helper/recipe_search.py index d5e0bd69..018368ae 100644 --- a/cookbook/helper/recipe_search.py +++ b/cookbook/helper/recipe_search.py @@ -44,7 +44,12 @@ class RecipeSearch(): 'or_not': self._params.get('foods_or_not', None), 'and_not': self._params.get('foods_and_not', None) } - self._books = self._params.get('books', None) + self._books = { + 'or': self._params.get('books_or', None), + 'and': self._params.get('books_and', None), + 'or_not': self._params.get('books_or_not', None), + 'and_not': self._params.get('books_and_not', None) + } self._steps = self._params.get('steps', None) self._units = self._params.get('units', None) # TODO add created by @@ -99,7 +104,7 @@ class RecipeSearch(): # self._last_cooked() self.keyword_filters(**self._keywords) self.food_filters(**self._foods) - self.book_filters(books=self._books, operator=self._books_or) + self.book_filters(**self._books) self.rating_filter(rating=self._rating) self.internal_filter() self.step_filters(steps=self._steps) @@ -269,16 +274,30 @@ class RecipeSearch(): def internal_filter(self): self._queryset = self._queryset.filter(internal=True) - def book_filters(self, books=None, operator=True): - if not books: + def book_filters(self, **kwargs): + if all([kwargs[x] is None for x in kwargs]): return - if not isinstance(books, list): - books = [books] - if operator == True: - self._queryset = self._queryset.filter(recipebookentry__book__id__in=books) - else: - for k in books: - self._queryset = self._queryset.filter(recipebookentry__book__id=k) + for bk_filter in kwargs: + if not kwargs[bk_filter]: + continue + if not isinstance(kwargs[bk_filter], list): + kwargs[bk_filter] = [kwargs[bk_filter]] + + if 'or' in bk_filter: + f = Q(recipebookentry__book__id__in=kwargs[bk_filter]) + if 'not' in bk_filter: + self._queryset = self._queryset.exclude(f) + else: + self._queryset = self._queryset.filter(f) + elif 'and' in bk_filter: + recipes = Recipe.objects.all() + for book in kwargs[bk_filter]: + if 'not' in bk_filter: + recipes = recipes.filter(recipebookentry__book__id=book) + else: + self._queryset = self._queryset.filter(recipebookentry__book__id=book) + if 'not' in bk_filter: + self._queryset = self._queryset.exclude(id__in=recipes.values('id')) def step_filters(self, steps=None, operator=True): if operator != True: diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 36460e3e..cb369aa2 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -634,19 +634,22 @@ class RecipeViewSet(viewsets.ModelViewSet): query_params = [ QueryParam(name='query', description=_('Query string matched (fuzzy) against recipe name. In the future also fulltext search.')), QueryParam(name='keywords', description=_('ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or'), qtype='int'), - QueryParam(name='keywords_or', description=_('Keyword IDs, repeat for multiple Return recipes with any of the keywords'), qtype='int'), - QueryParam(name='keywords_and', description=_('Keyword IDs, repeat for multiple Return recipes with all of the keywords.'), qtype='int'), - QueryParam(name='keywords_or_not', description=_('Keyword IDs, repeat for multiple Exclude recipes with any of the keywords.'), qtype='int'), - QueryParam(name='keywords_and_not', description=_('Keyword IDs, repeat for multiple Exclude recipes with all of the keywords.'), qtype='int'), + QueryParam(name='keywords_or', description=_('Keyword IDs, repeat for multiple. Return recipes with any of the keywords'), qtype='int'), + QueryParam(name='keywords_and', description=_('Keyword IDs, repeat for multiple. Return recipes with all of the keywords.'), qtype='int'), + QueryParam(name='keywords_or_not', description=_('Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords.'), qtype='int'), + QueryParam(name='keywords_and_not', description=_('Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords.'), qtype='int'), QueryParam(name='foods', description=_('ID of food a recipe should have. For multiple repeat parameter.'), qtype='int'), - QueryParam(name='foods_or', description=_('Food IDs, repeat for multiple Return recipes with any of the foods'), qtype='int'), - QueryParam(name='foods_and', description=_('Food IDs, repeat for multiple Return recipes with all of the foods.'), qtype='int'), - QueryParam(name='foods_or_not', description=_('Food IDs, repeat for multiple Exclude recipes with any of the foods.'), qtype='int'), - QueryParam(name='foods_and_not', description=_('Food IDs, repeat for multiple Exclude recipes with all of the foods.'), qtype='int'), + QueryParam(name='foods_or', description=_('Food IDs, repeat for multiple. Return recipes with any of the foods'), qtype='int'), + QueryParam(name='foods_and', description=_('Food IDs, repeat for multiple. Return recipes with all of the foods.'), qtype='int'), + QueryParam(name='foods_or_not', description=_('Food IDs, repeat for multiple. Exclude recipes with any of the foods.'), qtype='int'), + QueryParam(name='foods_and_not', description=_('Food IDs, repeat for multiple. Exclude recipes with all of the foods.'), qtype='int'), QueryParam(name='units', description=_('ID of unit a recipe should have.'), qtype='int'), QueryParam(name='rating', description=_('Rating a recipe should have. [0 - 5]'), qtype='int'), QueryParam(name='books', description=_('ID of book a recipe should be in. For multiple repeat parameter.')), - QueryParam(name='books_or', description=_('If recipe should be in all (AND=''false'') or any (OR=''true'') of the provided books.')), + QueryParam(name='books_or', description=_('Book IDs, repeat for multiple. Return recipes with any of the books'), qtype='int'), + QueryParam(name='books_and', description=_('Book IDs, repeat for multiple. Return recipes with all of the books.'), qtype='int'), + QueryParam(name='books_or_not', description=_('Book IDs, repeat for multiple. Exclude recipes with any of the books.'), qtype='int'), + QueryParam(name='books_and_not', description=_('Book IDs, repeat for multiple. Exclude recipes with all of the books.'), qtype='int'), QueryParam(name='internal', description=_('If only internal recipes should be returned. [''true''/''false'']')), QueryParam(name='random', description=_('Returns the results in randomized order. [''true''/''false'']')), QueryParam(name='new', description=_('Returns new results first in search results. [''true''/''false'']')), diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index dc010359..97944e41 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -274,13 +274,29 @@ +
{{ $t("Books") }}
- + + - - {{ $t("or") }} + + {{ $t("or") }} {{ $t("and") }} + + + + {{ $t("not") }} + + +
@@ -407,7 +430,7 @@ import RecipeSwitcher from "@/components/Buttons/RecipeSwitcher" Vue.use(VueCookies) Vue.use(BootstrapVue) -let SEARCH_COOKIE_NAME = "search_settings" +let SEARCH_COOKIE_NAME = "search_settings1" let UI_COOKIE_NAME = "ui_search_settings" export default { @@ -438,11 +461,15 @@ export default { { items: [], operator: true, not: false }, { items: [], operator: true, not: false }, ], - search_books: [], + search_books: [ + { items: [], operator: true, not: false }, + { items: [], operator: true, not: false }, + { items: [], operator: true, not: false }, + { items: [], operator: true, not: false }, + ], search_units: [], search_rating: undefined, search_rating_gte: true, - search_books_or: true, search_units_or: true, pagination_page: 1, expert_mode: false, @@ -692,10 +719,17 @@ export default { this.search.search_foods = this.search.search_foods.map((x) => { return { ...x, items: [] } }) - this.search.search_books = [] + this.search.search_book = this.search.search_book.map((x) => { + return { ...x, items: [] } + }) this.search.search_units = [] this.search.search_rating = undefined this.search.pagination_page = 1 + this.search.keywords_fields = 1 + this.search.foods_fields = 1 + this.search.books_fields = 1 + this.search.rating_fields = 1 + this.search.units_fields = 1 this.refreshData(false) }, pageChange: function (page) { @@ -764,12 +798,9 @@ export default { let params = { ...this.addFields("keywords"), ...this.addFields("foods"), + ...this.addFields("books"), query: this.search.search_input, rating: rating, - books: this.search.search_books.map(function (A) { - return A["id"] - }), - booksOr: this.search.search_books_or, internal: this.search.search_internal, random: this.random_search, _new: this.ui.sort_by_new, @@ -784,10 +815,9 @@ export default { }, searchFiltered: function (ignore_string = false) { let filtered = - this.search?.search_keywords[0].items?.length === 0 && - this.search?.search_foods[0].items?.length === 0 && - this.search?.search_books?.length === 0 && - // this.settings?.pagination_page === 1 && + this.search?.search_keywords?.[0]?.items?.length === 0 && + this.search?.search_foods?.[0]?.items?.length === 0 && + this.search?.search_books?.[0]?.items?.length === 0 && !this.random_search && this.search?.search_rating === undefined diff --git a/vue/src/utils/models.js b/vue/src/utils/models.js index 2639c5c3..cc02a0f4 100644 --- a/vue/src/utils/models.js +++ b/vue/src/utils/models.js @@ -448,7 +448,10 @@ export class Models { "units", "rating", "books", - "booksOr", + "books_or", + "books_and", + "books_or_not", + "books_and_not", "internal", "random", "_new", diff --git a/vue/src/utils/openapi/api.ts b/vue/src/utils/openapi/api.ts index 84f41168..240c496d 100644 --- a/vue/src/utils/openapi/api.ts +++ b/vue/src/utils/openapi/api.ts @@ -5283,19 +5283,22 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) * * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. * @param {number} [keywords] ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or - * @param {number} [keywordsOr] Keyword IDs, repeat for multiple Return recipes with any of the keywords - * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple Return recipes with all of the keywords. - * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple Exclude recipes with any of the keywords. - * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple Exclude recipes with all of the keywords. + * @param {number} [keywordsOr] Keyword IDs, repeat for multiple. Return recipes with any of the keywords + * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple. Return recipes with all of the keywords. + * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords. + * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords. * @param {number} [foods] ID of food a recipe should have. For multiple repeat parameter. - * @param {number} [foodsOr] Food IDs, repeat for multiple Return recipes with any of the foods - * @param {number} [foodsAnd] Food IDs, repeat for multiple Return recipes with all of the foods. - * @param {number} [foodsOrNot] Food IDs, repeat for multiple Exclude recipes with any of the foods. - * @param {number} [foodsAndNot] Food IDs, repeat for multiple Exclude recipes with all of the foods. + * @param {number} [foodsOr] Food IDs, repeat for multiple. Return recipes with any of the foods + * @param {number} [foodsAnd] Food IDs, repeat for multiple. Return recipes with all of the foods. + * @param {number} [foodsOrNot] Food IDs, repeat for multiple. Exclude recipes with any of the foods. + * @param {number} [foodsAndNot] Food IDs, repeat for multiple. Exclude recipes with all of the foods. * @param {number} [units] ID of unit a recipe should have. * @param {number} [rating] Rating a recipe should have. [0 - 5] * @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter. - * @param {string} [booksOr] If recipe should be in all (AND=false) or any (OR=<b>true</b>) of the provided books. + * @param {number} [booksOr] Book IDs, repeat for multiple. Return recipes with any of the books + * @param {number} [booksAnd] Book IDs, repeat for multiple. Return recipes with all of the books. + * @param {number} [booksOrNot] Book IDs, repeat for multiple. Exclude recipes with any of the books. + * @param {number} [booksAndNot] Book IDs, repeat for multiple. Exclude recipes with all of the books. * @param {string} [internal] If only internal recipes should be returned. [true/<b>false</b>] * @param {string} [random] Returns the results in randomized order. [true/<b>false</b>] * @param {string} [_new] Returns new results first in search results. [true/<b>false</b>] @@ -5304,7 +5307,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listRecipes: async (query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options: any = {}): Promise => { + listRecipes: async (query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options: any = {}): Promise => { const localVarPath = `/api/recipe/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -5377,6 +5380,18 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['books_or'] = booksOr; } + if (booksAnd !== undefined) { + localVarQueryParameter['books_and'] = booksAnd; + } + + if (booksOrNot !== undefined) { + localVarQueryParameter['books_or_not'] = booksOrNot; + } + + if (booksAndNot !== undefined) { + localVarQueryParameter['books_and_not'] = booksAndNot; + } + if (internal !== undefined) { localVarQueryParameter['internal'] = internal; } @@ -9703,19 +9718,22 @@ export const ApiApiFp = function(configuration?: Configuration) { * * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. * @param {number} [keywords] ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or - * @param {number} [keywordsOr] Keyword IDs, repeat for multiple Return recipes with any of the keywords - * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple Return recipes with all of the keywords. - * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple Exclude recipes with any of the keywords. - * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple Exclude recipes with all of the keywords. + * @param {number} [keywordsOr] Keyword IDs, repeat for multiple. Return recipes with any of the keywords + * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple. Return recipes with all of the keywords. + * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords. + * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords. * @param {number} [foods] ID of food a recipe should have. For multiple repeat parameter. - * @param {number} [foodsOr] Food IDs, repeat for multiple Return recipes with any of the foods - * @param {number} [foodsAnd] Food IDs, repeat for multiple Return recipes with all of the foods. - * @param {number} [foodsOrNot] Food IDs, repeat for multiple Exclude recipes with any of the foods. - * @param {number} [foodsAndNot] Food IDs, repeat for multiple Exclude recipes with all of the foods. + * @param {number} [foodsOr] Food IDs, repeat for multiple. Return recipes with any of the foods + * @param {number} [foodsAnd] Food IDs, repeat for multiple. Return recipes with all of the foods. + * @param {number} [foodsOrNot] Food IDs, repeat for multiple. Exclude recipes with any of the foods. + * @param {number} [foodsAndNot] Food IDs, repeat for multiple. Exclude recipes with all of the foods. * @param {number} [units] ID of unit a recipe should have. * @param {number} [rating] Rating a recipe should have. [0 - 5] * @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter. - * @param {string} [booksOr] If recipe should be in all (AND=false) or any (OR=<b>true</b>) of the provided books. + * @param {number} [booksOr] Book IDs, repeat for multiple. Return recipes with any of the books + * @param {number} [booksAnd] Book IDs, repeat for multiple. Return recipes with all of the books. + * @param {number} [booksOrNot] Book IDs, repeat for multiple. Exclude recipes with any of the books. + * @param {number} [booksAndNot] Book IDs, repeat for multiple. Exclude recipes with all of the books. * @param {string} [internal] If only internal recipes should be returned. [true/<b>false</b>] * @param {string} [random] Returns the results in randomized order. [true/<b>false</b>] * @param {string} [_new] Returns new results first in search results. [true/<b>false</b>] @@ -9724,8 +9742,8 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, internal, random, _new, page, pageSize, options); + async listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, booksAnd, booksOrNot, booksAndNot, internal, random, _new, page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -11394,19 +11412,22 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. * @param {number} [keywords] ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or - * @param {number} [keywordsOr] Keyword IDs, repeat for multiple Return recipes with any of the keywords - * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple Return recipes with all of the keywords. - * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple Exclude recipes with any of the keywords. - * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple Exclude recipes with all of the keywords. + * @param {number} [keywordsOr] Keyword IDs, repeat for multiple. Return recipes with any of the keywords + * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple. Return recipes with all of the keywords. + * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords. + * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords. * @param {number} [foods] ID of food a recipe should have. For multiple repeat parameter. - * @param {number} [foodsOr] Food IDs, repeat for multiple Return recipes with any of the foods - * @param {number} [foodsAnd] Food IDs, repeat for multiple Return recipes with all of the foods. - * @param {number} [foodsOrNot] Food IDs, repeat for multiple Exclude recipes with any of the foods. - * @param {number} [foodsAndNot] Food IDs, repeat for multiple Exclude recipes with all of the foods. + * @param {number} [foodsOr] Food IDs, repeat for multiple. Return recipes with any of the foods + * @param {number} [foodsAnd] Food IDs, repeat for multiple. Return recipes with all of the foods. + * @param {number} [foodsOrNot] Food IDs, repeat for multiple. Exclude recipes with any of the foods. + * @param {number} [foodsAndNot] Food IDs, repeat for multiple. Exclude recipes with all of the foods. * @param {number} [units] ID of unit a recipe should have. * @param {number} [rating] Rating a recipe should have. [0 - 5] * @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter. - * @param {string} [booksOr] If recipe should be in all (AND=false) or any (OR=<b>true</b>) of the provided books. + * @param {number} [booksOr] Book IDs, repeat for multiple. Return recipes with any of the books + * @param {number} [booksAnd] Book IDs, repeat for multiple. Return recipes with all of the books. + * @param {number} [booksOrNot] Book IDs, repeat for multiple. Exclude recipes with any of the books. + * @param {number} [booksAndNot] Book IDs, repeat for multiple. Exclude recipes with all of the books. * @param {string} [internal] If only internal recipes should be returned. [true/<b>false</b>] * @param {string} [random] Returns the results in randomized order. [true/<b>false</b>] * @param {string} [_new] Returns new results first in search results. [true/<b>false</b>] @@ -11415,8 +11436,8 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { - return localVarFp.listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(axios, basePath)); + listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, booksAnd, booksOrNot, booksAndNot, internal, random, _new, page, pageSize, options).then((request) => request(axios, basePath)); }, /** * @@ -13109,19 +13130,22 @@ export class ApiApi extends BaseAPI { * * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. * @param {number} [keywords] ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or - * @param {number} [keywordsOr] Keyword IDs, repeat for multiple Return recipes with any of the keywords - * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple Return recipes with all of the keywords. - * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple Exclude recipes with any of the keywords. - * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple Exclude recipes with all of the keywords. + * @param {number} [keywordsOr] Keyword IDs, repeat for multiple. Return recipes with any of the keywords + * @param {number} [keywordsAnd] Keyword IDs, repeat for multiple. Return recipes with all of the keywords. + * @param {number} [keywordsOrNot] Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords. + * @param {number} [keywordsAndNot] Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords. * @param {number} [foods] ID of food a recipe should have. For multiple repeat parameter. - * @param {number} [foodsOr] Food IDs, repeat for multiple Return recipes with any of the foods - * @param {number} [foodsAnd] Food IDs, repeat for multiple Return recipes with all of the foods. - * @param {number} [foodsOrNot] Food IDs, repeat for multiple Exclude recipes with any of the foods. - * @param {number} [foodsAndNot] Food IDs, repeat for multiple Exclude recipes with all of the foods. + * @param {number} [foodsOr] Food IDs, repeat for multiple. Return recipes with any of the foods + * @param {number} [foodsAnd] Food IDs, repeat for multiple. Return recipes with all of the foods. + * @param {number} [foodsOrNot] Food IDs, repeat for multiple. Exclude recipes with any of the foods. + * @param {number} [foodsAndNot] Food IDs, repeat for multiple. Exclude recipes with all of the foods. * @param {number} [units] ID of unit a recipe should have. * @param {number} [rating] Rating a recipe should have. [0 - 5] * @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter. - * @param {string} [booksOr] If recipe should be in all (AND=false) or any (OR=<b>true</b>) of the provided books. + * @param {number} [booksOr] Book IDs, repeat for multiple. Return recipes with any of the books + * @param {number} [booksAnd] Book IDs, repeat for multiple. Return recipes with all of the books. + * @param {number} [booksOrNot] Book IDs, repeat for multiple. Exclude recipes with any of the books. + * @param {number} [booksAndNot] Book IDs, repeat for multiple. Exclude recipes with all of the books. * @param {string} [internal] If only internal recipes should be returned. [true/<b>false</b>] * @param {string} [random] Returns the results in randomized order. [true/<b>false</b>] * @param {string} [_new] Returns new results first in search results. [true/<b>false</b>] @@ -13131,8 +13155,8 @@ export class ApiApi extends BaseAPI { * @throws {RequiredError} * @memberof ApiApi */ - public listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any) { - return ApiApiFp(this.configuration).listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(this.axios, this.basePath)); + public listRecipes(query?: string, keywords?: number, keywordsOr?: number, keywordsAnd?: number, keywordsOrNot?: number, keywordsAndNot?: number, foods?: number, foodsOr?: number, foodsAnd?: number, foodsOrNot?: number, foodsAndNot?: number, units?: number, rating?: number, books?: string, booksOr?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any) { + return ApiApiFp(this.configuration).listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, booksAnd, booksOrNot, booksAndNot, internal, random, _new, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } /**