Catch errors, prep to render them.

This commit is contained in:
James Cole 2019-05-17 06:52:16 +02:00
parent 9a53f17fff
commit 6e9128d894
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
4 changed files with 31 additions and 13 deletions

View File

@ -318,7 +318,7 @@ trait RequestInformation
$shownDemo = true;
// both must be array and either must be > 0
if (\count($intro) > 0 || \count($specialIntro) > 0) {
if (count($intro) > 0 || \count($specialIntro) > 0) {
$shownDemo = app('preferences')->get($key, false)->data;
Log::debug(sprintf('Check if user has already seen intro with key "%s". Result is %d', $key, $shownDemo));
}

21
public/v1/js/app.js vendored
View File

@ -51410,7 +51410,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
},
accountTypeFilters: function accountTypeFilters() {
var types = this.accountTypeFilters.join(',');
console.log(this.inputName + '[' + this.index + '] is now searching for: ' + types);
//console.log(this.inputName + '[' + this.index + '] is now searching for: ' + types);
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&query=";
}
},
@ -53776,7 +53776,7 @@ exports = module.exports = __webpack_require__(0)(false);
// module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
// exports
@ -53984,12 +53984,12 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
firstDestination = this.transactions[0].destination_account.type;
if ('invalid' === transactionType && ['Asset account', 'Loan', 'Debt', 'Mortgage'].includes(firstSource)) {
console.log('Assumed this is a withdrawal.');
//console.log('Assumed this is a withdrawal.');
transactionType = 'withdrawal';
}
if ('invalid' === transactionType && ['Asset account', 'Loan', 'Debt', 'Mortgage'].includes(firstDestination)) {
console.log('Assumed this is a deposit.');
//console.log('Assumed this is a deposit.');
transactionType = 'deposit';
}
@ -54038,7 +54038,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
});
}
}
console.log(data);
//console.log(data);
return data;
},
@ -54047,7 +54047,16 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
var data = this.convertData();
axios.post(uri, data).then(function (response) {
console.log(response);
console.log('OK!');
//console.log(response);
}).catch(function (error) {
// give user errors things back.
console.log('error!');
// something something render errors.
console.log(error.response.data);
// something.
});
if (e) {
e.preventDefault();

View File

@ -100,7 +100,7 @@
},
accountTypeFilters() {
let types = this.accountTypeFilters.join(',');
console.log(this.inputName + '[' + this.index + '] is now searching for: ' + types);
//console.log(this.inputName + '[' + this.index + '] is now searching for: ' + types);
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&query=";
}
},

View File

@ -197,12 +197,12 @@
if ('invalid' === transactionType && ['Asset account', 'Loan', 'Debt', 'Mortgage'].includes(firstSource)) {
console.log('Assumed this is a withdrawal.');
//console.log('Assumed this is a withdrawal.');
transactionType = 'withdrawal';
}
if ('invalid' === transactionType && ['Asset account', 'Loan', 'Debt', 'Mortgage'].includes(firstDestination)) {
console.log('Assumed this is a deposit.');
//console.log('Assumed this is a deposit.');
transactionType = 'deposit';
}
@ -254,7 +254,7 @@
);
}
}
console.log(data);
//console.log(data);
return data;
},
@ -264,8 +264,17 @@
axios.post(uri, data)
.then(response => {
console.log(response);
});
console.log('OK!');
//console.log(response);
}).catch(error => {
// give user errors things back.
console.log('error!');
// something something render errors.
console.log(error.response.data);
// something.
});
if (e) {
e.preventDefault();
}