fix get_facets_API

This commit is contained in:
smilerz
2021-12-16 08:13:10 -06:00
parent edc670e87d
commit d4553c05c2
4 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1066,7 +1066,7 @@ def ingredient_from_string(request):
@group_required('user') @group_required('user')
def get_facets(request): def get_facets(request):
key = request.GET['hash'] key = request.GET.get('hash', None)
return JsonResponse( return JsonResponse(
{ {

View File

@@ -9,7 +9,7 @@
<b-input-group> <b-input-group>
<b-input class="form-control form-control-lg form-control-borderless form-control-search" v-model="settings.search_input" v-bind:placeholder="$t('Search')"></b-input> <b-input class="form-control form-control-lg form-control-borderless form-control-search" v-model="settings.search_input" v-bind:placeholder="$t('Search')"></b-input>
<b-input-group-append> <b-input-group-append>
<b-button v-b-tooltip.hover :title="$t('show_sql')" @click="showSQL()"> <b-button v-b-tooltip.hover :title="$t('show_sql')" @click="showSQL()" v-if="debug">
<i class="fas fa-bug" style="font-size: 1.5em"></i> <i class="fas fa-bug" style="font-size: 1.5em"></i>
</b-button> </b-button>
<b-button variant="light" v-b-tooltip.hover :title="$t('Random Recipes')" @click="openRandom()"> <b-button variant="light" v-b-tooltip.hover :title="$t('Random Recipes')" @click="openRandom()">
@@ -238,7 +238,7 @@ Vue.use(VueCookies)
import { ApiMixin, ResolveUrlMixin } from "@/utils/utils" import { ApiMixin, ResolveUrlMixin } from "@/utils/utils"
import LoadingSpinner from "@/components/LoadingSpinner" // is this deprecated? import LoadingSpinner from "@/components/LoadingSpinner" // TODO: is this deprecated?
import RecipeCard from "@/components/RecipeCard" import RecipeCard from "@/components/RecipeCard"
import GenericMultiselect from "@/components/GenericMultiselect" import GenericMultiselect from "@/components/GenericMultiselect"

View File

@@ -220,7 +220,7 @@ export const ApiMixin = {
return { return {
Models: Models, Models: Models,
Actions: Actions, Actions: Actions,
FoodCreateDefault: function(form) { FoodCreateDefault: function (form) {
form.inherit_ignore = getUserPreference("food_ignore_default") form.inherit_ignore = getUserPreference("food_ignore_default")
form.inherit = form.supermarket_category.length > 0 form.inherit = form.supermarket_category.length > 0
return form return form
@@ -538,7 +538,7 @@ const specialCases = {
} }
export const formFunctions = { export const formFunctions = {
FoodCreateDefault: function(form) { FoodCreateDefault: function (form) {
form.fields.filter((x) => x.field === "ignore_inherit")[0].value = getUserPreference("food_ignore_default") form.fields.filter((x) => x.field === "ignore_inherit")[0].value = getUserPreference("food_ignore_default")
form.fields.filter((x) => x.field === "inherit")[0].value = getUserPreference("food_ignore_default").length > 0 form.fields.filter((x) => x.field === "inherit")[0].value = getUserPreference("food_ignore_default").length > 0
return form return form