support aggregating account/category and tag info in transaction list/get api

This commit is contained in:
MaysWind
2021-03-21 21:39:46 +08:00
parent 460450af1d
commit 44f2a651f7
5 changed files with 242 additions and 32 deletions
+2 -2
View File
@@ -253,10 +253,10 @@ export default {
});
},
getTransactions: ({ maxTime, minTime, type, categoryId, accountId, keyword }) => {
return axios.get(`v1/transactions/list.json?max_time=${maxTime}&min_time=${minTime}&type=${type}&category_id=${categoryId}&account_id=${accountId}&keyword=${keyword}&count=50`);
return axios.get(`v1/transactions/list.json?max_time=${maxTime}&min_time=${minTime}&type=${type}&category_id=${categoryId}&account_id=${accountId}&keyword=${keyword}&count=50&trim_account=true&trim_category=true&trim_tag=true`);
},
getTransaction: ({ id }) => {
return axios.get(`v1/transactions/get.json?id=${id}`);
return axios.get(`v1/transactions/get.json?id=${id}&trim_account=true&trim_category=true&trim_tag=true`);
},
addTransaction: ({ type, categoryId, time, sourceAccountId, destinationAccountId, sourceAmount, destinationAmount, tagIds, comment, utcOffset }) => {
return axios.post('v1/transactions/add.json', {