mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
fixed issue with shopping list saving
This commit is contained in:
@@ -681,7 +681,7 @@
|
|||||||
Promise.allSettled(recipe_promises).then(() => {
|
Promise.allSettled(recipe_promises).then(() => {
|
||||||
console.log("proceeding to update shopping list", this.shopping_list)
|
console.log("proceeding to update shopping list", this.shopping_list)
|
||||||
|
|
||||||
if (this.shopping_list_id === null) {
|
if (this.shopping_list.id === undefined) {
|
||||||
return this.$http.post("{% url 'api:shoppinglist-list' %}", this.shopping_list, {}).then((response) => {
|
return this.$http.post("{% url 'api:shoppinglist-list' %}", this.shopping_list, {}).then((response) => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.makeToast(gettext('Updated'), gettext('Object created successfully!'), 'success')
|
this.makeToast(gettext('Updated'), gettext('Object created successfully!'), 'success')
|
||||||
@@ -697,7 +697,7 @@
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return this.$http.put("{% url 'api:shoppinglist-detail' shopping_list_id %}", this.shopping_list, {}).then((response) => {
|
return this.$http.put("{% url 'api:shoppinglist-detail' 123456 %}".replace('123456', this.shopping_list.id), this.shopping_list, {}).then((response) => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.shopping_list = response.body
|
this.shopping_list = response.body
|
||||||
this.makeToast(gettext('Updated'), gettext('Changes saved successfully!'), 'success')
|
this.makeToast(gettext('Updated'), gettext('Changes saved successfully!'), 'success')
|
||||||
|
|||||||
Reference in New Issue
Block a user