mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-02 02:18:20 +00:00
Should fix message title.
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user