Skip to content

Firefly III: a personal finances manager

Should fix message title.

James Colebafe2ece8c94
diff --git a/resources/assets/js/components/transactions/EditTransaction.vue b/resources/assets/js/components/transactions/EditTransaction.vue
index ed6f797e4d..885ebb8192 100644
--- a/resources/assets/js/components/transactions/EditTransaction.vue
+++ b/resources/assets/js/components/transactions/EditTransaction.vue
@@ -395,7 +395,7 @@ export default {
getGroup() {
// console.log('EditTransaction: getGroup()');
const page = window.location.href.split('/');
- const groupId = page[page.length - 1];
+ const groupId = parseInt(page[page.length - 1]);
const uri = './api/v1/transactions/' + groupId;
@@ -746,7 +746,7 @@ export default {
button.prop("disabled", true);
const page = window.location.href.split('/');
- const groupId = page[page.length - 1];
+ const groupId = parseInt(page[page.length - 1]);
let uri = './api/v1/transactions/' + groupId + '?_token=' + document.head.querySelector('meta[name="csrf-token"]').content;
let method = 'PUT';
if (this.storeAsNew) {
@@ -763,7 +763,8 @@ export default {
data: data,
}).then(response => {
if (0 === this.collectAttachmentData(response)) {
- this.redirectUser(response.data.data.id);
+ const title = response.data.data.attributes.group_title ?? response.data.data.attributes.transactions[0].description;
+ this.redirectUser(response.data.data.id, title);
}
}).catch(error => {
// give user errors things back.
@@ -777,15 +778,15 @@ export default {
button.removeAttr('disabled');
},
- redirectUser(groupId) {
+ redirectUser(groupId, title) {
if (this.returnAfter) {
this.setDefaultErrors();
// do message if update or new:
if (this.storeAsNew) {
- this.success_message = this.$t('firefly.transaction_new_stored_link', {ID: groupId});
+ this.success_message = this.$t('firefly.transaction_new_stored_link', {ID: groupId, title: title});
this.error_message = '';
} else {
- this.success_message = this.$t('firefly.transaction_updated_link', {ID: groupId});
+ this.success_message = this.$t('firefly.transaction_updated_link', {ID: groupId, title: title});
this.error_message = '';
}
} else {
diff --git a/resources/assets/js/components/webhooks/Show.vue b/resources/assets/js/components/webhooks/Show.vue
index e6ad0d7368..32f9f74980 100644
--- a/resources/assets/js/components/webhooks/Show.vue
+++ b/resources/assets/js/components/webhooks/Show.vue
@@ -277,7 +277,7 @@ export default {
getWebhook() {
this.loading = true;
const page = window.location.href.split('/');
- this.id = page[page.length - 1]
+ this.id = parseInt(page[page.length - 1]);
this.downloadWebhook();
this.downloadWebhookMessages();
},