added err msg to all standard toasts
This commit is contained in:
parent
e4223787be
commit
30d5587fbe
@ -132,8 +132,8 @@ export default {
|
|||||||
this.refreshData()
|
this.refreshData()
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
appendRecipeFilter: function (page, book) {
|
appendRecipeFilter: function (page, book) {
|
||||||
|
@ -117,8 +117,7 @@ export default {
|
|||||||
this.recipe_list.push(response.data)
|
this.recipe_list.push(response.data)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
// .then((e) => this.searchRecipes(""))
|
// .then((e) => this.searchRecipes(""))
|
||||||
},
|
},
|
||||||
|
@ -187,7 +187,7 @@ export default {
|
|||||||
this.ingredients = result.data
|
this.ingredients = result.data
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -208,8 +208,8 @@ export default {
|
|||||||
let apiClient = new ApiApiFactory()
|
let apiClient = new ApiApiFactory()
|
||||||
apiClient.updateIngredient(i.id, i).then(r => {
|
apiClient.updateIngredient(i.id, i).then(r => {
|
||||||
this.$set(i, 'changed', false)
|
this.$set(i, 'changed', false)
|
||||||
}).catch((r, e) => {
|
}).catch(err => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -219,8 +219,8 @@ export default {
|
|||||||
apiClient.destroyIngredient(i.id).then(r => {
|
apiClient.destroyIngredient(i.id).then(r => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
this.ingredients = this.ingredients.filter(li => li.id !== i.id)
|
this.ingredients = this.ingredients.filter(li => li.id !== i.id)
|
||||||
}).catch(e => {
|
}).catch(err => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -450,8 +450,8 @@ export default {
|
|||||||
.then((e) => {
|
.then((e) => {
|
||||||
this.periodChangedCallback(this.current_period)
|
this.periodChangedCallback(this.current_period)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.refreshMealTypes()
|
this.refreshMealTypes()
|
||||||
@ -473,8 +473,8 @@ export default {
|
|||||||
updated++
|
updated++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -490,8 +490,8 @@ export default {
|
|||||||
this.periodChangedCallback(this.current_period)
|
this.periodChangedCallback(this.current_period)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.meal_types[index], "editing", true)
|
this.$set(this.meal_types[index], "editing", true)
|
||||||
@ -506,8 +506,8 @@ export default {
|
|||||||
this.periodChangedCallback(this.current_period)
|
this.periodChangedCallback(this.current_period)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateEmoji: function (field, value) {
|
updateEmoji: function (field, value) {
|
||||||
@ -582,8 +582,8 @@ export default {
|
|||||||
.then((e) => {
|
.then((e) => {
|
||||||
list.splice(index, 1)
|
list.splice(index, 1)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -634,8 +634,8 @@ export default {
|
|||||||
|
|
||||||
let apiClient = new ApiApiFactory()
|
let apiClient = new ApiApiFactory()
|
||||||
|
|
||||||
apiClient.updateMealPlan(entry.id, entry).catch((error) => {
|
apiClient.updateMealPlan(entry.id, entry).catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createEntry(entry) {
|
createEntry(entry) {
|
||||||
@ -645,8 +645,8 @@ export default {
|
|||||||
|
|
||||||
apiClient
|
apiClient
|
||||||
.createMealPlan(entry)
|
.createMealPlan(entry)
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
.then((entry_result) => {
|
.then((entry_result) => {
|
||||||
this.plan_entries.push(entry_result.data)
|
this.plan_entries.push(entry_result.data)
|
||||||
|
@ -275,8 +275,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, Object.keys(err))
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getThis: function (id, callback) {
|
getThis: function (id, callback) {
|
||||||
@ -295,8 +294,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.genericAPI(this.this_model, this.Actions.UPDATE, item)
|
this.genericAPI(this.this_model, this.Actions.UPDATE, item)
|
||||||
@ -305,8 +303,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, err.response)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -432,7 +429,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getRecipes: function (col, item) {
|
getRecipes: function (col, item) {
|
||||||
|
@ -821,8 +821,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateRecipe: function (view_after) {
|
updateRecipe: function (view_after) {
|
||||||
@ -863,8 +862,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
uploadImage: function (file) {
|
uploadImage: function (file) {
|
||||||
@ -878,8 +876,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
console.log(err.request, err.response)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -894,8 +891,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
console.log(err.request, err.response)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -990,8 +986,7 @@ export default {
|
|||||||
this.keywords_loading = false
|
this.keywords_loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchFiles: function (query) {
|
searchFiles: function (query) {
|
||||||
@ -1005,8 +1000,7 @@ export default {
|
|||||||
this.files_loading = false
|
this.files_loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchRecipes: function (query) {
|
searchRecipes: function (query) {
|
||||||
@ -1017,8 +1011,7 @@ export default {
|
|||||||
this.recipes_loading = false
|
this.recipes_loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchUnits: function (query) {
|
searchUnits: function (query) {
|
||||||
@ -1042,7 +1035,7 @@ export default {
|
|||||||
this.units_loading = false
|
this.units_loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchFoods: function (query) {
|
searchFoods: function (query) {
|
||||||
@ -1067,7 +1060,7 @@ export default {
|
|||||||
this.foods_loading = false
|
this.foods_loading = false
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fileCreated: function (data) {
|
fileCreated: function (data) {
|
||||||
|
@ -1499,8 +1499,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, Object.keys(err))
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addField: function (field, count) {
|
addField: function (field, count) {
|
||||||
|
@ -1121,8 +1121,7 @@ export default {
|
|||||||
this.clear += 1
|
this.clear += 1
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteSupermarket: function (s) {
|
deleteSupermarket: function (s) {
|
||||||
@ -1133,8 +1132,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteCategory: function (c) {
|
deleteCategory: function (c) {
|
||||||
@ -1149,8 +1147,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resetFilters: function () {
|
resetFilters: function () {
|
||||||
@ -1192,8 +1189,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteThis: function (item) {
|
deleteThis: function (item) {
|
||||||
@ -1209,8 +1205,7 @@ export default {
|
|||||||
entries.forEach((x) => {
|
entries.forEach((x) => {
|
||||||
promises.push(
|
promises.push(
|
||||||
api.destroyShoppingListEntry(x).catch((err) => {
|
api.destroyShoppingListEntry(x).catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -1265,9 +1260,8 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
|
||||||
if (!autosync) {
|
if (!autosync) {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -1356,8 +1350,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
saveThis: function (thisItem, toast = true) {
|
saveThis: function (thisItem, toast = true) {
|
||||||
@ -1372,8 +1365,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return api
|
return api
|
||||||
@ -1384,8 +1376,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, err.response)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1415,8 +1406,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.auto_sync_blocked = false
|
this.auto_sync_blocked = false
|
||||||
console.log(err, err.response)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateFood: function (food, field) {
|
updateFood: function (food, field) {
|
||||||
@ -1435,8 +1425,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, Object.keys(err))
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateServings(e, plan) {
|
updateServings(e, plan) {
|
||||||
|
@ -116,8 +116,8 @@ export default {
|
|||||||
.then((result) => {
|
.then((result) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshData: function () {
|
refreshData: function () {
|
||||||
@ -137,8 +137,8 @@ export default {
|
|||||||
this.$emit("refresh")
|
this.$emit("refresh")
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -184,11 +184,11 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (del_shopping) {
|
if (del_shopping) {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
} else if (this.selected_shoppingrecipe) {
|
} else if (this.selected_shoppingrecipe) {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
} else {
|
} else {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
}
|
}
|
||||||
this.$emit("shopping-failed")
|
this.$emit("shopping-failed")
|
||||||
})
|
})
|
||||||
|
@ -98,8 +98,8 @@ export default {
|
|||||||
apiFactory.createRecipeBookEntry({book: this.selected_book.id, recipe: this.recipe.id}).then(r => {
|
apiFactory.createRecipeBookEntry({book: this.selected_book.id, recipe: this.recipe.id}).then(r => {
|
||||||
this.recipe_book_list.push(r.data)
|
this.recipe_book_list.push(r.data)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
}).catch(e => {
|
}).catch(err => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeFromBook: function (book_entry) {
|
removeFromBook: function (book_entry) {
|
||||||
|
@ -177,9 +177,9 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err.response.status === 403){
|
if (err.response.status === 403){
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE_PROTECTED)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE_PROTECTED, err)
|
||||||
}else {
|
}else {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||||
}
|
}
|
||||||
this.$emit("finish-action", "cancel")
|
this.$emit("finish-action", "cancel")
|
||||||
})
|
})
|
||||||
@ -204,8 +204,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err, err.response)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
|
||||||
this.$emit("finish-action", "cancel")
|
this.$emit("finish-action", "cancel")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -227,8 +226,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MOVE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MOVE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MOVE, err)
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MOVE)
|
|
||||||
this.$emit("finish-action", "cancel")
|
this.$emit("finish-action", "cancel")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -252,9 +250,7 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MERGE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MERGE)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
//TODO error checking not working with OpenAPI methods
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MERGE, err)
|
||||||
console.log("Error", err)
|
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MERGE)
|
|
||||||
this.$emit("finish-action", "cancel")
|
this.$emit("finish-action", "cancel")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ export default {
|
|||||||
this.$emit("finish")
|
this.$emit("finish")
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$bvModal.hide(`shopping_${this.modal_id}`)
|
this.$bvModal.hide(`shopping_${this.modal_id}`)
|
||||||
|
@ -164,8 +164,8 @@ export default {
|
|||||||
}
|
}
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createMealPlan(data) {
|
createMealPlan(data) {
|
||||||
@ -231,8 +231,8 @@ export default {
|
|||||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||||
window.open(this.resolveDjangoUrl("view_recipe", new_recipe.data.id))
|
window.open(this.resolveDjangoUrl("view_recipe", new_recipe.data.id))
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user