Fix issue on dashboard.

This commit is contained in:
James Cole 2023-10-01 06:52:38 +02:00
parent 3e6aca4cd1
commit aa629523a0
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
6 changed files with 33 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -30,10 +30,10 @@
"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6" "integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"
}, },
"resources/assets/v2/pages/dashboard/dashboard.js": { "resources/assets/v2/pages/dashboard/dashboard.js": {
"file": "assets/dashboard-b749bce8.js", "file": "assets/dashboard-307bb616.js",
"isEntry": true, "isEntry": true,
"src": "resources/assets/v2/pages/dashboard/dashboard.js", "src": "resources/assets/v2/pages/dashboard/dashboard.js",
"integrity": "sha384-TvAKEMJR8ONhKUtSgHwMgfm3VeK89DxeTTgj9L9CLSaYYbwX5sZZVM+U672RgNDU" "integrity": "sha384-12LQTVUhQ8NDyfArIhB/HjBxu9v2Mo7PO76JNWBlHQStvJtW80r4RRNvE7jifPQS"
}, },
"resources/assets/v2/sass/app.scss": { "resources/assets/v2/sass/app.scss": {
"file": "assets/app-28a195fd.css", "file": "assets/app-28a195fd.css",

View File

@ -30,7 +30,7 @@ export default class Get {
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
get(identifier, date) { get(identifier, date) {
let params = {date: format(date, 'y-MM-d').slice(0, 10)}; let params = {date: format(date, 'y-MM-dd').slice(0, 10)};
if (!date) { if (!date) {
return api.get('/api/v1/accounts/' + identifier); return api.get('/api/v1/accounts/' + identifier);
} }

View File

@ -30,7 +30,7 @@ export default class Get {
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
get(identifier, date) { get(identifier, date) {
let params = {date: format(date, 'y-MM-d').slice(0, 10)}; let params = {date: format(date, 'y-MM-dd').slice(0, 10)};
if (!date) { if (!date) {
return api.get('/api/v2/accounts/' + identifier); return api.get('/api/v2/accounts/' + identifier);
} }
@ -40,10 +40,20 @@ export default class Get {
/** /**
* *
* @param identifier * @param identifier
* @param page * @param params
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
transactions(identifier, page) { transactions(identifier, params) {
return api.get('/api/v2/accounts/' + identifier + '/transactions', {params: {page: page}}); const newParams = {
page: params.page ?? 1
};
if (params.hasOwnProperty('start')) {
newParams.start = format(params.start, 'y-MM-dd');
}
if (params.hasOwnProperty('end')) {
newParams.end = format(params.end, 'y-MM-dd');
}
return api.get('/api/v2/accounts/' + identifier + '/transactions', {params: newParams});
} }
} }

View File

@ -186,7 +186,12 @@ export default () => ({
let parent = response.data.data; let parent = response.data.data;
// get groups for account: // get groups for account:
(new Get).transactions(parent.id, 1).then((response) => { const params = {
page: 1,
start: new Date(window.store.get('start')),
end: new Date(window.store.get('end')),
};
(new Get).transactions(parent.id, params).then((response) => {
let groups = []; let groups = [];
for (let ii = 0; ii < response.data.data.length; ii++) { for (let ii = 0; ii < response.data.data.length; ii++) {
if (ii >= max) { if (ii >= max) {

View File

@ -49,8 +49,8 @@ return [
'transaction_types_equal' => 'All splits must be of the same type.', 'transaction_types_equal' => 'All splits must be of the same type.',
'invalid_transaction_type' => 'Invalid transaction type.', 'invalid_transaction_type' => 'Invalid transaction type.',
'invalid_selection' => 'Your selection is invalid.', 'invalid_selection' => 'Your selection is invalid.',
'belongs_user' => 'This value is linked to an object that does not belong to you.', 'belongs_user' => 'This value is linked to an object that does not seem to exist.',
'belongs_user_or_user_group' => 'This value is linked to an object that does not belong to your current financial administration.', 'belongs_user_or_user_group' => 'This value is linked to an object that does not seem to exist in your current financial administration.',
'at_least_one_transaction' => 'Need at least one transaction.', 'at_least_one_transaction' => 'Need at least one transaction.',
'recurring_transaction_id' => 'Need at least one transaction.', 'recurring_transaction_id' => 'Need at least one transaction.',
'need_id_to_match' => 'You need to submit this entry with an ID for the API to be able to match it.', 'need_id_to_match' => 'You need to submit this entry with an ID for the API to be able to match it.',