From 419c1a75dd958e534c6241222033f5df56bf2682 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 23 Feb 2021 06:42:04 +0100 Subject: [PATCH] Better event. --- .../src/components/transactions/Create.vue | 55 ++----------------- .../transactions/TransactionAmount.vue | 30 +++++----- .../transactions/TransactionLinks.vue | 4 +- .../transactions/TransactionNotes.vue | 2 +- 4 files changed, 23 insertions(+), 68 deletions(-) diff --git a/frontend/src/components/transactions/Create.vue b/frontend/src/components/transactions/Create.vue index cfc0da61c4..075a077b84 100644 --- a/frontend/src/components/transactions/Create.vue +++ b/frontend/src/components/transactions/Create.vue @@ -33,15 +33,14 @@ :custom-fields="customFields" :submitted-transaction="submittedTransaction" v-on:uploaded-attachments="uploadedAttachment($event)" - v-on:set-description="storeField($event)" v-on:set-marker-location="storeLocation($event)" v-on:set-account="storeAccountValue($event)" v-on:switch-accounts="switchAccounts($event)" - v-on:set-amount="storeAmount(index, $event)" - v-on:set-foreign-currency-id="storeField($event)" - v-on:set-foreign-amount="storeField($event)" v-on:set-date="storeDate($event)" v-on:set-time="storeTime($event)" + v-on:set-amount="storeField($event)" + v-on:set-foreign-currency-id="storeField($event)" + v-on:set-foreign-amount="storeField($event)" v-on:set-custom-date="storeField($event)" v-on:set-budget="storeField($event)" v-on:set-category="storeField($event)" @@ -50,8 +49,9 @@ v-on:set-piggy-bank="storeField($event)" v-on:set-internal-reference="storeField($event)" v-on:set-external-url="storeField($event)" - v-on:set-notes="storeNotes(index, $event)" - v-on:set-links="storeLinks(index, $event)" + v-on:set-notes="storeField($event)" + v-on:set-links="storeField($event)" + v-on:set-description="storeField($event)" /> @@ -402,55 +402,12 @@ export default { storeField: function (payload) { this.updateField(payload); }, - storeDescription: function (index, value) { - this.updateField({field: 'description', index: index, value: value}); - }, - storeForeignCurrencyId: function (index, value) { - console.log('storeForeignCurrencyId(' + index + ',' + value + ')'); - this.updateField({field: 'foreign_currency_id', index: index, value: value}); - }, - storeAmount: function (index, value) { - this.updateField({field: 'amount', index: index, value: value}); - }, - storeForeignAmount: function (index, value) { - this.updateField({field: 'foreign_amount', index: index, value: value}); - }, storeDate: function (value) { this.setDate(value.date) }, storeTime: function (value) { this.setTime(value.time) }, - storeCustomDate: function (index, payload) { - this.updateField({field: payload.field, index: index, value: payload.date}); - }, - storeBudget: function (index, value) { - this.updateField({field: 'budget_id', index: index, value: value}); - }, - storeCategory: function (index, value) { - this.updateField({field: 'category', index: index, value: value}); - }, - storeBill: function (index, value) { - this.updateField({field: 'bill_id', index: index, value: value}); - }, - storeTags: function (index, value) { - this.updateField({field: 'tags', index: index, value: value}); - }, - storePiggyBank: function (index, value) { - this.updateField({field: 'piggy_bank_id', index: index, value: value}); - }, - storeInternalReference: function (index, value) { - this.updateField({field: 'internal_reference', index: index, value: value}); - }, - storeExternalUrl: function (index, value) { - this.updateField({field: 'external_url', index: index, value: value}); - }, - storeNotes: function (index, value) { - this.updateField({field: 'notes', index: index, value: value}); - }, - storeLinks: function (index, value) { - this.updateField({field: 'links', index: index, value: value}); - }, /** * Calculate the transaction type based on what's currently in the store. diff --git a/frontend/src/components/transactions/TransactionAmount.vue b/frontend/src/components/transactions/TransactionAmount.vue index d98887d1e9..1f2d43f5c6 100644 --- a/frontend/src/components/transactions/TransactionAmount.vue +++ b/frontend/src/components/transactions/TransactionAmount.vue @@ -38,7 +38,7 @@ {{ error }}
- +