From 6e9128d89452e6425b9b1b0b19c7805c92089a08 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 17 May 2019 06:52:16 +0200 Subject: [PATCH] Catch errors, prep to render them. --- .../Http/Controllers/RequestInformation.php | 2 +- public/v1/js/app.js | 21 +++++++++++++------ .../components/transactions/AccountSelect.vue | 2 +- .../transactions/CreateTransaction.vue | 19 ++++++++++++----- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 4ca7b1effd..65268bccf6 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -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)); } diff --git a/public/v1/js/app.js b/public/v1/js/app.js index 0b128eb9df..6bc350981e 100644 --- a/public/v1/js/app.js +++ b/public/v1/js/app.js @@ -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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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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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(); diff --git a/resources/assets/js/components/transactions/AccountSelect.vue b/resources/assets/js/components/transactions/AccountSelect.vue index 34b6153976..3bf2dcc401 100644 --- a/resources/assets/js/components/transactions/AccountSelect.vue +++ b/resources/assets/js/components/transactions/AccountSelect.vue @@ -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="; } }, diff --git a/resources/assets/js/components/transactions/CreateTransaction.vue b/resources/assets/js/components/transactions/CreateTransaction.vue index 62d0cd427f..231d5f2720 100644 --- a/resources/assets/js/components/transactions/CreateTransaction.vue +++ b/resources/assets/js/components/transactions/CreateTransaction.vue @@ -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(); }