mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 05:39:00 -05:00
added err msg to all standard toasts
This commit is contained in:
@@ -132,8 +132,8 @@ export default {
|
||||
this.refreshData()
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
},
|
||||
appendRecipeFilter: function (page, book) {
|
||||
|
||||
@@ -117,8 +117,7 @@ export default {
|
||||
this.recipe_list.push(response.data)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
// .then((e) => this.searchRecipes(""))
|
||||
},
|
||||
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
this.ingredients = result.data
|
||||
this.loading = false
|
||||
}).catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
@@ -208,8 +208,8 @@ export default {
|
||||
let apiClient = new ApiApiFactory()
|
||||
apiClient.updateIngredient(i.id, i).then(r => {
|
||||
this.$set(i, 'changed', false)
|
||||
}).catch((r, e) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
}).catch(err => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -219,8 +219,8 @@ export default {
|
||||
apiClient.destroyIngredient(i.id).then(r => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
this.ingredients = this.ingredients.filter(li => li.id !== i.id)
|
||||
}).catch(e => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
}).catch(err => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,8 +450,8 @@ export default {
|
||||
.then((e) => {
|
||||
this.periodChangedCallback(this.current_period)
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
|
||||
this.refreshMealTypes()
|
||||
@@ -473,8 +473,8 @@ export default {
|
||||
updated++
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -490,8 +490,8 @@ export default {
|
||||
this.periodChangedCallback(this.current_period)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
} else {
|
||||
this.$set(this.meal_types[index], "editing", true)
|
||||
@@ -506,8 +506,8 @@ export default {
|
||||
this.periodChangedCallback(this.current_period)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
},
|
||||
updateEmoji: function (field, value) {
|
||||
@@ -582,8 +582,8 @@ export default {
|
||||
.then((e) => {
|
||||
list.splice(index, 1)
|
||||
})
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -634,8 +634,8 @@ export default {
|
||||
|
||||
let apiClient = new ApiApiFactory()
|
||||
|
||||
apiClient.updateMealPlan(entry.id, entry).catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
apiClient.updateMealPlan(entry.id, entry).catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
createEntry(entry) {
|
||||
@@ -645,8 +645,8 @@ export default {
|
||||
|
||||
apiClient
|
||||
.createMealPlan(entry)
|
||||
.catch((error) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
.then((entry_result) => {
|
||||
this.plan_entries.push(entry_result.data)
|
||||
|
||||
@@ -275,8 +275,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, Object.keys(err))
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
getThis: function (id, callback) {
|
||||
@@ -295,8 +294,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
} else {
|
||||
this.genericAPI(this.this_model, this.Actions.UPDATE, item)
|
||||
@@ -305,8 +303,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, err.response)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -432,7 +429,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
getRecipes: function (col, item) {
|
||||
|
||||
@@ -821,8 +821,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
updateRecipe: function (view_after) {
|
||||
@@ -863,8 +862,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
uploadImage: function (file) {
|
||||
@@ -878,8 +876,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
|
||||
})
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
console.log(err.request, err.response)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -894,8 +891,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
})
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
console.log(err.request, err.response)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -990,8 +986,7 @@ export default {
|
||||
this.keywords_loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
searchFiles: function (query) {
|
||||
@@ -1005,8 +1000,7 @@ export default {
|
||||
this.files_loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
searchRecipes: function (query) {
|
||||
@@ -1017,8 +1011,7 @@ export default {
|
||||
this.recipes_loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
searchUnits: function (query) {
|
||||
@@ -1042,7 +1035,7 @@ export default {
|
||||
this.units_loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
searchFoods: function (query) {
|
||||
@@ -1067,7 +1060,7 @@ export default {
|
||||
this.foods_loading = false
|
||||
})
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH, err)
|
||||
})
|
||||
},
|
||||
fileCreated: function (data) {
|
||||
|
||||
@@ -1499,8 +1499,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, Object.keys(err))
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
},
|
||||
addField: function (field, count) {
|
||||
|
||||
@@ -1121,8 +1121,7 @@ export default {
|
||||
this.clear += 1
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
},
|
||||
deleteSupermarket: function (s) {
|
||||
@@ -1133,8 +1132,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
},
|
||||
deleteCategory: function (c) {
|
||||
@@ -1149,8 +1147,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
},
|
||||
resetFilters: function () {
|
||||
@@ -1192,8 +1189,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
},
|
||||
deleteThis: function (item) {
|
||||
@@ -1209,8 +1205,7 @@ export default {
|
||||
entries.forEach((x) => {
|
||||
promises.push(
|
||||
api.destroyShoppingListEntry(x).catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
})
|
||||
)
|
||||
})
|
||||
@@ -1265,9 +1260,8 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
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)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
saveThis: function (thisItem, toast = true) {
|
||||
@@ -1372,8 +1365,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
} else {
|
||||
return api
|
||||
@@ -1384,8 +1376,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, err.response)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -1415,8 +1406,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
this.auto_sync_blocked = false
|
||||
console.log(err, err.response)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
updateFood: function (food, field) {
|
||||
@@ -1435,8 +1425,7 @@ export default {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, Object.keys(err))
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
updateServings(e, plan) {
|
||||
|
||||
Reference in New Issue
Block a user