updated standard toast function

This commit is contained in:
vabene1111
2022-04-23 01:31:15 +02:00
parent 3850287deb
commit e4223787be
20 changed files with 204 additions and 149 deletions

View File

@ -822,7 +822,7 @@ export default {
.catch((err) => {
this.loading = false
console.log(err)
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
updateRecipe: function (view_after) {
@ -850,7 +850,7 @@ export default {
apiFactory
.updateRecipe(this.recipe_id, this.recipe, {})
.then((response) => {
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE)
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
this.recipe_changed = false
if (this.create_food) {
apiFactory.createFood({
@ -864,7 +864,7 @@ export default {
})
.catch((err) => {
console.log(err)
StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
})
},
uploadImage: function (file) {
@ -875,10 +875,10 @@ export default {
.then((request) => {
this.recipe.image = request.data.image
this.recipe_changed = false
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE)
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_UPDATE)
})
.catch((err) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
console.log(err.request, err.response)
})
}
@ -891,10 +891,10 @@ export default {
.then((request) => {
this.recipe.image = null
this.recipe_changed = false
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_DELETE)
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
})
.catch((err) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_DELETE)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
console.log(err.request, err.response)
})
}
@ -991,7 +991,7 @@ export default {
})
.catch((err) => {
console.log(err)
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
searchFiles: function (query) {
@ -1006,7 +1006,7 @@ export default {
})
.catch((err) => {
console.log(err)
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
searchRecipes: function (query) {
@ -1018,7 +1018,7 @@ export default {
})
.catch((err) => {
console.log(err)
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
searchUnits: function (query) {
@ -1042,7 +1042,7 @@ export default {
this.units_loading = false
})
.catch((err) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
searchFoods: function (query) {
@ -1067,7 +1067,7 @@ export default {
this.foods_loading = false
})
.catch((err) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
})
},
fileCreated: function (data) {