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

@@ -187,7 +187,7 @@ export default {
this.ingredients = result.data
this.loading = false
}).catch((err) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_FETCH)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_FETCH)
this.loading = false
})
}
@@ -209,7 +209,7 @@ export default {
apiClient.updateIngredient(i.id, i).then(r => {
this.$set(i, 'changed', false)
}).catch((r, e) => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_UPDATE)
})
})
},
@@ -217,10 +217,10 @@ export default {
if (confirm(this.$t('delete_confirmation', this.$t('Ingredient')))){
let apiClient = new ApiApiFactory()
apiClient.destroyIngredient(i.id).then(r => {
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_DELETE)
StandardToasts.makeStandardToast(this,StandardToasts.SUCCESS_DELETE)
this.ingredients = this.ingredients.filter(li => li.id !== i.id)
}).catch(e => {
StandardToasts.makeStandardToast(StandardToasts.FAIL_DELETE)
StandardToasts.makeStandardToast(this,StandardToasts.FAIL_DELETE)
})
}
}