added save confirm

This commit is contained in:
vabene1111 2020-07-05 22:36:39 +02:00
parent 5b916e955c
commit 5f2320a3e7

View File

@ -408,7 +408,7 @@
el: '#id_base_container', el: '#id_base_container',
data: { data: {
recipe: undefined, recipe: undefined,
recipe_changed: false, recipe_changed: undefined,
keywords: [], keywords: [],
keywords_loading: false, keywords_loading: false,
foods: [], foods: [],
@ -428,9 +428,9 @@
recipe: { recipe: {
deep: true, deep: true,
handler() { handler() {
if (!this.loading) { if (this.recipe_changed === undefined) {
this.recipe_changed = false
console.log('CHANGED') } else {
this.recipe_changed = true this.recipe_changed = true
} }
} }
@ -456,7 +456,6 @@
this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => { this.$http.get("{% url 'api:recipe-detail' recipe.pk %}").then((response) => {
this.recipe = response.data; this.recipe = response.data;
this.loading = false this.loading = false
this.recipe_changed = false
}).catch((err) => { }).catch((err) => {
this.loading = false this.loading = false
console.log(err) console.log(err)