fixed search facets and sub recipe

This commit is contained in:
vabene1111
2021-09-04 19:26:42 +02:00
parent 738387ccf0
commit 16d125a243
4 changed files with 16 additions and 10 deletions

View File

@@ -252,7 +252,6 @@
select-label="{% trans 'Select' %}"
:id="'id_step_' + step.id + '_recipe'"
:custom-label="opt => recipes.find(x => x.id == opt).name"
:multiple="false"
:loading="recipes_loading"
@search-change="searchRecipes">
@@ -615,6 +614,13 @@
this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => {
this.recipe = response.data;
this.loading = false
//TODO workaround function until view is properly refactored, loads name of selected sub recipe so the input can find its label
this.recipe.steps.forEach(s => {
if (s.step_recipe != null) {
this.recipes.push(s.step_recipe_data)
}
})
}).catch((err) => {
this.loading = false
console.log(err)