mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
partially working steps edit view
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user