diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index d01faf6bd..490996f0c 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -13,7 +13,7 @@ name="month-selection" > - +
@@ -61,11 +61,10 @@ variant="success" class="test-submit" @click="submitCreation" - :disabled="radioSelected === '' || value <= 0 || text.length < 10" + :disabled="selected === '' || value <= 0 || text.length < 10" > {{ $t('creation_form.update_creation') }} - name === obj.item) this.text = this.$t('creation_form.creation_for') + ' ' + name.short + ' ' + name.year if (this.type === 'singleCreation') { this.rangeMin = 0 @@ -150,15 +143,10 @@ export default { } }, submitCreation() { + let submitObj = [] if (this.type === 'massCreation') { - // Die anzahl der Mitglieder aus der Mehrfachschöpfung - const i = Object.keys(this.items).length - // hinweis das eine Mehrfachschöpfung ausgeführt wird an (Anzahl der MItgleider an die geschöpft wird) - // eslint-disable-next-line no-console - console.log('SUBMIT CREATION => ' + this.type + ' >> für VIELE ' + i + ' Mitglieder') - this.submitObj = [] this.items.forEach((item) => { - this.submitObj.push({ + submitObj.push({ email: item.email, creationDate: this.selected.date, amount: Number(this.value), @@ -166,13 +154,11 @@ export default { moderator: Number(this.$store.state.moderator.id), }) }) - // eslint-disable-next-line no-console - console.log('MehrfachSCHÖPFUNG ABSENDEN FÜR >> ' + i + ' Mitglieder') this.$apollo .mutate({ mutation: createPendingCreations, variables: { - pendingCreations: this.submitObj, + pendingCreations: submitObj, }, fetchPolicy: 'no-cache', }) @@ -192,7 +178,7 @@ export default { this.$toasted.error(error.message) }) } else if (this.type === 'singleCreation') { - this.submitObj = { + submitObj = { email: this.item.email, creationDate: this.selected.date, amount: Number(this.value), @@ -202,7 +188,7 @@ export default { this.$apollo .mutate({ mutation: createPendingCreation, - variables: this.submitObj, + variables: submitObj, }) .then((result) => { this.$emit('update-user-data', this.item, result.data.createPendingCreation) @@ -213,8 +199,6 @@ export default { }), ) this.$store.commit('openCreationsPlus', 1) - this.submitObj = null - this.createdIndex = null // das creation Formular reseten this.$refs.creationForm.reset() // Den geschöpften Wert auf o setzen @@ -222,7 +206,6 @@ export default { }) .catch((error) => { this.$toasted.error(error.message) - this.submitObj = null // das creation Formular reseten this.$refs.creationForm.reset() // Den geschöpften Wert auf o setzen