create plan page refactoring

This commit is contained in:
Čarodej
2021-11-25 14:19:04 +01:00
parent 3bfca2ac83
commit 7f6598238e
6 changed files with 255 additions and 167 deletions

View File

@@ -20,6 +20,22 @@ const FunctionHelpers = {
})
}, 150)
Vue.prototype.$updateInput = debounce(function (route, name, value, allowEmpty = false) {
if ((value === '' || value === ' ' || typeof value === 'object') && !allowEmpty) return
axios.post(this.$store.getters.api + route, {
[name]: value,
_method: 'patch'
})
.catch(() => {
events.$emit('alert:open', {
title: this.$t('popup_error.title'),
message: this.$t('popup_error.message'),
})
})
}, 150)
Vue.prototype.$updateImage = function (route, name, image) {
// Create form