mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 04:39:54 -05:00
added err msg to all standard toasts
This commit is contained in:
@@ -98,8 +98,8 @@ export default {
|
||||
apiFactory.createRecipeBookEntry({book: this.selected_book.id, recipe: this.recipe.id}).then(r => {
|
||||
this.recipe_book_list.push(r.data)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_CREATE)
|
||||
}).catch(e => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
|
||||
}).catch(err => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
},
|
||||
removeFromBook: function (book_entry) {
|
||||
|
||||
@@ -177,9 +177,9 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err.response.status === 403){
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE_PROTECTED)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE_PROTECTED, err)
|
||||
}else {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE, err)
|
||||
}
|
||||
this.$emit("finish-action", "cancel")
|
||||
})
|
||||
@@ -204,8 +204,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)
|
||||
this.$emit("finish-action", "cancel")
|
||||
})
|
||||
}
|
||||
@@ -227,8 +226,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MOVE)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MOVE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MOVE, err)
|
||||
this.$emit("finish-action", "cancel")
|
||||
})
|
||||
},
|
||||
@@ -252,9 +250,7 @@ export default {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_MERGE)
|
||||
})
|
||||
.catch((err) => {
|
||||
//TODO error checking not working with OpenAPI methods
|
||||
console.log("Error", err)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MERGE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_MERGE, err)
|
||||
this.$emit("finish-action", "cancel")
|
||||
})
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ export default {
|
||||
this.$emit("finish")
|
||||
})
|
||||
.catch((err) => {
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE)
|
||||
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_CREATE, err)
|
||||
})
|
||||
|
||||
this.$bvModal.hide(`shopping_${this.modal_id}`)
|
||||
|
||||
Reference in New Issue
Block a user