partially working steps edit view

This commit is contained in:
vabene1111
2020-06-25 23:48:27 +02:00
parent 4a6b32d9af
commit 381bc5ffb4
4 changed files with 36 additions and 3 deletions

View File

@@ -61,6 +61,7 @@
</div>
</div>
<button type="button" @click="updateRecipe()">Save</button>
</template>
</div>
@@ -93,7 +94,7 @@
},
methods: {
loadRecipe: function () {
this.$http.get("{% url 'api:recipe-list' %}{{ recipe.pk }}").then((response) => {
this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => {
this.recipe = response.data;
this.loading = false
}).catch((err) => {
@@ -102,6 +103,13 @@
console.log(err)
})
},
updateRecipe: function () {
this.$http.put("{% url 'api:recipe-detail' recipe.pk %}", this.recipe).then((response) => {
console.log(response)
}).catch((err) => {
console.log(err)
})
},
searchKeywords: function (query) {
this.keywords_loading = true
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query).then((response) => {