makenow filter

This commit is contained in:
Chris Scoggins 2022-01-24 14:36:25 -06:00
parent ebb0b3a5ea
commit 5959914932
No known key found for this signature in database
GPG Key ID: 41617A4206CCBAC6
8 changed files with 207 additions and 52 deletions

View File

@ -37,7 +37,6 @@ class RecipeSearch():
'or_not': self._params.get('keywords_or_not', None),
'and_not': self._params.get('keywords_and_not', None)
}
self._foods = {
'or': self._params.get('foods_or', None),
'and': self._params.get('foods_and', None),
@ -53,7 +52,6 @@ class RecipeSearch():
self._steps = self._params.get('steps', None)
self._units = self._params.get('units', None)
# TODO add created by
# TODO add created before/after
# TODO image exists
self._sort_order = self._params.get('sort_order', None)
self._books_or = str2bool(self._params.get('books_or', True))
@ -61,6 +59,9 @@ class RecipeSearch():
self._random = str2bool(self._params.get('random', False))
self._new = str2bool(self._params.get('new', False))
self._last_viewed = int(self._params.get('last_viewed', 0))
self._timescooked = self._params.get('timescooked', None)
self._lastcooked = self._params.get('lastcooked', None)
self._makenow = self._params.get('makenow', None)
self._search_type = self._search_prefs.search or 'plain'
if self._string:
@ -96,8 +97,8 @@ class RecipeSearch():
self._queryset = queryset
self._build_sort_order()
self._recently_viewed(num_recent=self._last_viewed)
self._last_cooked()
self._favorite_recipes()
self._last_cooked(lastcooked=self._lastcooked)
self._favorite_recipes(timescooked=self._timescooked)
self._new_recipes()
self.keyword_filters(**self._keywords)
self.food_filters(**self._foods)
@ -107,6 +108,8 @@ class RecipeSearch():
self.step_filters(steps=self._steps)
self.unit_filters(units=self._units)
self.string_filters(string=self._string)
self._makenow_filter()
# self._queryset = self._queryset.distinct() # TODO 2x check. maybe add filter of recipe__in after orderby
return self._queryset.filter(space=self._request.space).order_by(*self.orderby)
@ -185,10 +188,19 @@ class RecipeSearch():
else:
self._queryset = self._queryset.filter(name__icontains=self._string)
def _last_cooked(self):
if self._sort_includes('lastcooked'):
def _last_cooked(self, lastcooked=None):
if self._sort_includes('lastcooked') or lastcooked:
longTimeAgo = timezone.now() - timedelta(days=100000)
self._queryset = self._queryset.annotate(lastcooked=Coalesce(
Max(Case(When(created_by=self._request.user, space=self._request.space, then='cooklog__pk'))), Value(0)))
Max(Case(When(created_by=self._request.user, space=self._request.space, then='cooklog__created_at'))), Value(longTimeAgo)))
if lastcooked is None:
return
lessthan = '-' in lastcooked[:1]
if lessthan:
self._queryset = self._queryset.filter(lastcooked__lte=lastcooked[1:]).exclude(lastcooked=longTimeAgo)
else:
self._queryset = self._queryset.filter(lastcooked__gte=lastcooked).exclude(lastcooked=longTimeAgo)
def _new_recipes(self, new_days=7):
# TODO make new days a user-setting
@ -210,11 +222,20 @@ class RecipeSearch():
'recipe').annotate(recent=Max('created_at')).order_by('-recent')[:num_recent]
self._queryset = self._queryset.annotate(recent=Coalesce(Max(Case(When(pk__in=last_viewed_recipes.values('recipe'), then='viewlog__pk'))), Value(0)))
def _favorite_recipes(self):
if self._sort_includes('favorite'):
def _favorite_recipes(self, timescooked=None):
if self._sort_includes('favorite') or timescooked:
favorite_recipes = CookLog.objects.filter(created_by=self._request.user, space=self._request.space, recipe=OuterRef('pk')
).values('recipe').annotate(count=Count('pk', distinct=True)).values('count')
self._queryset = self._queryset.annotate(favorite=Coalesce(Subquery(favorite_recipes), 0))
if timescooked is None:
return
lessthan = '-' in timescooked
if timescooked == '0':
self._queryset = self._queryset.filter(favorite=0)
elif lessthan:
self._queryset = self._queryset.filter(favorite__lte=int(timescooked[1:])).exclude(favorite=0)
else:
self._queryset = self._queryset.filter(favorite__gte=int(timescooked))
def keyword_filters(self, **kwargs):
if all([kwargs[x] is None for x in kwargs]):
@ -285,7 +306,7 @@ class RecipeSearch():
return
lessthan = '-' in rating
if rating == 0:
if rating == '0':
self._queryset = self._queryset.filter(rating=0)
elif lessthan:
self._queryset = self._queryset.filter(rating__lte=int(rating[1:])).exclude(rating=0)
@ -373,6 +394,16 @@ class RecipeSearch():
).annotate(simularity=Max('trigram')).values('id', 'simularity').filter(simularity__gt=self._search_prefs.trigram_threshold)
self._filters += [Q(pk__in=self._fuzzy_match.values('pk'))]
def _makenow_filter(self):
if not self._makenow:
return
shopping_users = [*self._request.user.get_shopping_share(), self._request.user]
self._queryset = self._queryset.annotate(
count_food=Count('steps__ingredients__food'),
count_onhand=Count('pk', filter=Q(steps__ingredients__food__onhand_users__in=shopping_users, steps__ingredients__food__ignore_shopping=False)),
count_ignore=Count('pk', filter=Q(steps__ingredients__food__ignore_shopping=True))
).annotate(missingfood=F('count_food')-F('count_onhand')-F('count_ignore')).filter(missingfood=0)
class RecipeFacet():
class CacheEmpty(Exception):

View File

@ -645,7 +645,7 @@ class RecipeViewSet(viewsets.ModelViewSet):
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='rating', description=_('Rating a recipe should have or greater. [0 - 5] Negative value filters rating less than.'), qtype='int'),
QueryParam(name='books', description=_('ID of book a recipe should be in. For multiple repeat parameter.')),
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'),
@ -654,6 +654,9 @@ class RecipeViewSet(viewsets.ModelViewSet):
QueryParam(name='internal', description=_('If only internal recipes should be returned. [''true''/''<b>false</b>'']')),
QueryParam(name='random', description=_('Returns the results in randomized order. [''true''/''<b>false</b>'']')),
QueryParam(name='new', description=_('Returns new results first in search results. [''true''/''<b>false</b>'']')),
QueryParam(name='timescooked', description=_('Filter recipes cooked X times or more. Negative values returns cooked less than X times'), qtype='int'),
QueryParam(name='lastcooked', description=_('Filter recipes last cooked on or after YYYY-MM-DD. Prepending ''-'' filters on or before date.')),
QueryParam(name='makenow', description=_('Filter recipes that can be made with OnHand food. [''true''/''<b>false</b>'']'), qtype='int'),
]
schema = QueryParamAutoSchema()

View File

@ -115,6 +115,15 @@
<b-form-group v-if="ui.enable_expert" v-bind:label="$t('show_sortby')" label-for="popover-show_sortby" label-cols="8" class="mb-1">
<b-form-checkbox switch v-model="ui.show_sortby" id="popover-show_sortby" size="sm"></b-form-checkbox>
</b-form-group>
<b-form-group v-if="ui.enable_expert" v-bind:label="$t('times_cooked')" label-for="popover-show_sortby" label-cols="8" class="mb-1">
<b-form-checkbox switch v-model="ui.show_timescooked" id="popover-show_cooked" size="sm"></b-form-checkbox>
</b-form-group>
<b-form-group v-if="ui.enable_expert" v-bind:label="$t('make_now')" label-for="popover-show_sortby" label-cols="8" class="mb-1">
<b-form-checkbox switch v-model="ui.show_makenow" id="popover-show_makenow" size="sm"></b-form-checkbox>
</b-form-group>
<b-form-group v-if="ui.enable_expert" v-bind:label="$t('last_cooked')" label-for="popover-show_sortby" label-cols="8" class="mb-1">
<b-form-checkbox switch v-model="ui.show_lastcooked" id="popover-show_lastcooked" size="sm"></b-form-checkbox>
</b-form-group>
</b-tab>
<b-tab :title="$t('advanced')" :title-link-class="['mx-0']">
@ -356,8 +365,8 @@
</div>
<!-- ratings filter -->
<div class="row" v-if="ui.show_rating">
<div class="col-12">
<div class="row g-0" v-if="ui.show_rating">
<div class="col-12" v-if="ui.show_rating">
<b-input-group class="mt-2">
<treeselect
v-model="search.search_rating"
@ -403,6 +412,53 @@
</b-input-group>
</div>
</div>
<!-- special switches -->
<div class="row g-0" v-if="ui.show_timescooked || ui.show_makenow || ui.show_lastcooked">
<div class="col-12">
<b-input-group class="mt-2">
<!-- times cooked -->
<b-input-group-prepend is-text v-if="ui.show_timescooked">
{{ $t("times_cooked") }}
</b-input-group-prepend>
<b-form-input id="timescooked" type="number" min="0" v-model="search.timescooked" v-if="ui.show_timescooked"></b-form-input>
<b-input-group-append v-if="ui.show_timescooked">
<b-input-group-text>
<b-form-checkbox v-model="search.timescooked_gte" name="check-button" @change="refreshData(false)" class="shadow-none" switch style="width: 4em">
<span class="text-uppercase" v-if="search.timescooked_gte">&gt;=</span>
<span class="text-uppercase" v-else>&lt;=</span>
</b-form-checkbox>
</b-input-group-text>
</b-input-group-append>
<!-- date cooked -->
<b-input-group-append v-if="ui.show_lastcooked">
<b-form-datepicker
v-model="search.lastcooked"
:max="yesterday"
no-highlight-today
reset-button
:date-format-options="{ year: 'numeric', month: 'numeric', day: 'numeric' }"
:locale="locale"
:placeholder="$t('last_cooked')"
@input="refreshData(false)"
/>
<b-input-group-text>
<b-form-checkbox v-model="search.lastcooked_gte" name="check-button" @change="refreshData(false)" class="shadow-none" switch style="width: 4em">
<span class="text-uppercase" v-if="search.lastcooked_gte">&gt;=</span>
<span class="text-uppercase" v-else>&lt;=</span>
</b-form-checkbox>
</b-input-group-text>
</b-input-group-append>
<!-- make now -->
<b-input-group-append v-if="ui.show_makenow">
<b-input-group-text>
{{ $t("make_now") }}
<b-form-checkbox v-model="search.makenow" name="check-button" @change="refreshData(false)" class="shadow-none" switch style="width: 4em" />
</b-input-group-text>
</b-input-group-append>
</b-input-group>
</div>
</div>
<div v-if="ui.enable_expert && searchFiltered(false)" class="row justify-content-end small">
<div class="col-auto">
<b-button class="my-0" variant="link" size="sm" @click="saveSearch">
@ -418,7 +474,7 @@
<div class="row align-content-center">
<div class="col col-md-6" style="margin-top: 2vh">
<b-dropdown split :text="$t('sort_by')" variant="link" class="m-0 p-0">
<b-dropdown id="sortby" split :text="$t('sort_by')" variant="link" class="m-0 p-0">
<div v-for="o in sortOptions" :key="o.id">
<b-dropdown-item
v-on:click="
@ -525,6 +581,11 @@ export default {
search_rating_gte: true,
search_units_or: true,
search_filter: undefined,
timescooked: undefined,
timescooked_gte: true,
makenow: false,
lastcooked: undefined,
lastcooked_gte: true,
sort_order: [],
pagination_page: 1,
expert_mode: false,
@ -552,6 +613,9 @@ export default {
show_units: false,
show_filters: false,
show_sortby: false,
show_timescooked: false,
show_makenow: false,
show_lastcooked: false,
},
pagination_count: 0,
random_search: false,
@ -559,6 +623,13 @@ export default {
}
},
computed: {
locale: function () {
return window.CUSTOM_LOCALE
},
yesterday: function () {
const now = new Date()
return new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1)
},
ratingOptions: function () {
let ratingCount = undefined
let label = undefined
@ -718,6 +789,14 @@ export default {
},
deep: true,
},
"search.search_input": _debounce(function () {
this.search.pagination_page = 1
this.pagination_count = 0
this.refreshData(false)
}, 300),
"search.timescooked": function () {
this.refreshData(false)
},
"ui.show_meal_plan": function () {
this.loadMealPlan()
},
@ -732,18 +811,13 @@ export default {
this.getFacets(this.facets?.cache_key)
}
},
"search.search_input": _debounce(function () {
this.search.pagination_page = 1
this.pagination_count = 0
this.refreshData(false)
}, 300),
"ui.page_size": _debounce(function () {
this.refreshData(false)
}, 300),
},
methods: {
// this.genericAPI inherited from ApiMixin
refreshData: function (random) {
refreshData: _debounce(function (random) {
let params = this.buildParams(random)
this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params)
.then((result) => {
@ -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 {
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
<style>
.vue-treeselect__control {
.vue-treeselect__control,
#timescooked,
#makenow {
border-radius: 0px !important;
height: 44px;
line-height: 22px;
}
.multiselect__tags {
border-radius: 0px !important;

View File

@ -97,7 +97,6 @@ export default {
}
},
mounted() {
console.log("shopping modal")
this.recipe_servings = this.servings
},
computed: {
@ -106,18 +105,19 @@ export default {
},
},
watch: {
recipe: {
handler() {
this.loadRecipe()
},
deep: true,
},
// recipe: {
// handler() {
// this.loadRecipe()
// },
// deep: true,
// },
servings: function (newVal) {
this.recipe_servings = parseInt(newVal)
},
},
methods: {
loadRecipe: function () {
console.log("loading recipe")
this.add_shopping = []
this.related_recipes = []
let apiClient = new ApiApiFactory()

View File

@ -100,7 +100,7 @@ export default {
return {
servings_value: 0,
recipe_share_link: undefined,
modal_id: undefined,
modal_id: Math.round(Math.random() * 100000),
options: {
entryEditing: {
date: null,
@ -200,7 +200,6 @@ export default {
navigator.share(shareData)
},
addToShopping() {
this.modal_id = this.recipe.id + Math.round(Math.random() * 100000)
this.$bvModal.show(`shopping_${this.modal_id}`)
},
},

View File

@ -324,5 +324,6 @@
"times_cooked": "Times Cooked",
"date_created": "Date Created",
"show_sortby": "Show Sort By",
"search_rank": "Search Rank"
"search_rank": "Search Rank",
"make_now": "Make Now"
}

View File

@ -455,15 +455,13 @@ export class Models {
"internal",
"random",
"_new",
"timescooked",
"lastcooked",
"makenow",
"page",
"pageSize",
"options",
],
// 'config': {
// 'foods': {'type': 'string'},
// 'keywords': {'type': 'string'},
// 'books': {'type': 'string'},
// }
},
shopping: {
params: ["id", ["id", "list_recipe", "ingredients", "servings"]],

View File

@ -202,7 +202,7 @@ export interface CustomFilter {
* @type {Array<CustomFilterShared>}
* @memberof CustomFilter
*/
shared: Array<CustomFilterShared>;
shared?: Array<CustomFilterShared>;
/**
*
* @type {string}
@ -5431,7 +5431,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
* @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 {number} [rating] Rating a recipe should have or greater. [0 - 5] Negative value filters rating less than.
* @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter.
* @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.
@ -5440,12 +5440,15 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
* @param {string} [internal] If only internal recipes should be returned. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [random] Returns the results in randomized order. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [_new] Returns new results first in search results. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [timescooked] Filter recipes cooked X times or more. Negative values returns cooked less than X times
* @param {string} [lastcooked] Filter recipes last cooked on or after YYYY-MM-DD. Prepending - filters on or before date.
* @param {number} [makenow] Filter recipes that can be made with OnHand food. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @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?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
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, timescooked?: number, lastcooked?: string, makenow?: number, page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
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);
@ -5542,6 +5545,18 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
localVarQueryParameter['new'] = _new;
}
if (timescooked !== undefined) {
localVarQueryParameter['timescooked'] = timescooked;
}
if (lastcooked !== undefined) {
localVarQueryParameter['lastcooked'] = lastcooked;
}
if (makenow !== undefined) {
localVarQueryParameter['makenow'] = makenow;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
@ -10002,7 +10017,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @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 {number} [rating] Rating a recipe should have or greater. [0 - 5] Negative value filters rating less than.
* @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter.
* @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.
@ -10011,13 +10026,16 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @param {string} [internal] If only internal recipes should be returned. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [random] Returns the results in randomized order. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [_new] Returns new results first in search results. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [timescooked] Filter recipes cooked X times or more. Negative values returns cooked less than X times
* @param {string} [lastcooked] Filter recipes last cooked on or after YYYY-MM-DD. Prepending - filters on or before date.
* @param {number} [makenow] Filter recipes that can be made with OnHand food. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @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?: 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<InlineResponse2004>> {
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);
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, timescooked?: number, lastcooked?: string, makenow?: number, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2004>> {
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, timescooked, lastcooked, makenow, page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
@ -11754,7 +11772,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @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 {number} [rating] Rating a recipe should have or greater. [0 - 5] Negative value filters rating less than.
* @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter.
* @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.
@ -11763,13 +11781,16 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @param {string} [internal] If only internal recipes should be returned. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [random] Returns the results in randomized order. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [_new] Returns new results first in search results. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [timescooked] Filter recipes cooked X times or more. Negative values returns cooked less than X times
* @param {string} [lastcooked] Filter recipes last cooked on or after YYYY-MM-DD. Prepending - filters on or before date.
* @param {number} [makenow] Filter recipes that can be made with OnHand food. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @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?: number, booksAnd?: number, booksOrNot?: number, booksAndNot?: number, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2004> {
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));
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, timescooked?: number, lastcooked?: string, makenow?: number, page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2004> {
return localVarFp.listRecipes(query, keywords, keywordsOr, keywordsAnd, keywordsOrNot, keywordsAndNot, foods, foodsOr, foodsAnd, foodsOrNot, foodsAndNot, units, rating, books, booksOr, booksAnd, booksOrNot, booksAndNot, internal, random, _new, timescooked, lastcooked, makenow, page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
@ -13533,7 +13554,7 @@ export class ApiApi extends BaseAPI {
* @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 {number} [rating] Rating a recipe should have or greater. [0 - 5] Negative value filters rating less than.
* @param {string} [books] ID of book a recipe should be in. For multiple repeat parameter.
* @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.
@ -13542,14 +13563,17 @@ export class ApiApi extends BaseAPI {
* @param {string} [internal] If only internal recipes should be returned. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [random] Returns the results in randomized order. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {string} [_new] Returns new results first in search results. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [timescooked] Filter recipes cooked X times or more. Negative values returns cooked less than X times
* @param {string} [lastcooked] Filter recipes last cooked on or after YYYY-MM-DD. Prepending - filters on or before date.
* @param {number} [makenow] Filter recipes that can be made with OnHand food. [true/&lt;b&gt;false&lt;/b&gt;]
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @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?: 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));
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, timescooked?: number, lastcooked?: string, makenow?: number, 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, timescooked, lastcooked, makenow, page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**