tag filter supports selecting both included and excluded tags simultaneously
This commit is contained in:
+11
-16
@@ -417,11 +417,12 @@ export default {
|
||||
let params = '';
|
||||
|
||||
if (req) {
|
||||
const tagFilter = encodeURIComponent(req.tagFilter);
|
||||
const amountFilter = encodeURIComponent(req.amountFilter);
|
||||
const keyword = encodeURIComponent(req.keyword);
|
||||
params = `max_time=${req.maxTime}&min_time=${req.minTime}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_ids=${req.tagIds}&tag_filter_type=${req.tagFilterType}&amount_filter=${amountFilter}&keyword=${keyword}`;
|
||||
params = `max_time=${req.maxTime}&min_time=${req.minTime}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_filter=${tagFilter}&amount_filter=${amountFilter}&keyword=${keyword}`;
|
||||
} else {
|
||||
params = 'max_time=0&min_time=0&type=0&category_ids=&account_ids=&tag_ids=&tag_filter_type=0&amount_filter=&keyword=';
|
||||
params = 'max_time=0&min_time=0&type=0&category_ids=&account_ids=&tag_filter=&amount_filter=&keyword=';
|
||||
}
|
||||
|
||||
if (fileType === 'csv') {
|
||||
@@ -476,14 +477,16 @@ export default {
|
||||
return axios.post<ApiResponse<boolean>>('v1/accounts/sub_account/delete.json', req);
|
||||
},
|
||||
getTransactions: (req: TransactionListByMaxTimeRequest): ApiResponsePromise<TransactionInfoPageWrapperResponse> => {
|
||||
const tagFilter = encodeURIComponent(req.tagFilter);
|
||||
const amountFilter = encodeURIComponent(req.amountFilter);
|
||||
const keyword = encodeURIComponent(req.keyword);
|
||||
return axios.get<ApiResponse<TransactionInfoPageWrapperResponse>>(`v1/transactions/list.json?max_time=${req.maxTime}&min_time=${req.minTime}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_ids=${req.tagIds}&tag_filter_type=${req.tagFilterType}&amount_filter=${amountFilter}&keyword=${keyword}&count=${req.count}&page=${req.page}&with_count=${req.withCount}&trim_account=true&trim_category=true&trim_tag=true`);
|
||||
return axios.get<ApiResponse<TransactionInfoPageWrapperResponse>>(`v1/transactions/list.json?max_time=${req.maxTime}&min_time=${req.minTime}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_filter=${tagFilter}&amount_filter=${amountFilter}&keyword=${keyword}&count=${req.count}&page=${req.page}&with_count=${req.withCount}&trim_account=true&trim_category=true&trim_tag=true`);
|
||||
},
|
||||
getAllTransactionsByMonth: (req: TransactionListInMonthByPageRequest): ApiResponsePromise<TransactionInfoPageWrapperResponse2> => {
|
||||
const tagFilter = encodeURIComponent(req.tagFilter);
|
||||
const amountFilter = encodeURIComponent(req.amountFilter);
|
||||
const keyword = encodeURIComponent(req.keyword);
|
||||
return axios.get<ApiResponse<TransactionInfoPageWrapperResponse2>>(`v1/transactions/list/by_month.json?year=${req.year}&month=${req.month}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_ids=${req.tagIds}&tag_filter_type=${req.tagFilterType}&amount_filter=${amountFilter}&keyword=${keyword}&trim_account=true&trim_category=true&trim_tag=true`);
|
||||
return axios.get<ApiResponse<TransactionInfoPageWrapperResponse2>>(`v1/transactions/list/by_month.json?year=${req.year}&month=${req.month}&type=${req.type}&category_ids=${req.categoryIds}&account_ids=${req.accountIds}&tag_filter=${tagFilter}&amount_filter=${amountFilter}&keyword=${keyword}&trim_account=true&trim_category=true&trim_tag=true`);
|
||||
},
|
||||
getReconciliationStatements: (req: TransactionReconciliationStatementRequest): ApiResponsePromise<TransactionReconciliationStatementResponse> => {
|
||||
return axios.get<ApiResponse<TransactionReconciliationStatementResponse>>(`v1/transactions/reconciliation_statements.json?account_id=${req.accountId}&start_time=${req.startTime}&end_time=${req.endTime}`);
|
||||
@@ -499,12 +502,8 @@ export default {
|
||||
queryParams.push(`end_time=${req.endTime}`);
|
||||
}
|
||||
|
||||
if (req.tagIds) {
|
||||
queryParams.push(`tag_ids=${req.tagIds}`);
|
||||
}
|
||||
|
||||
if (req.tagFilterType) {
|
||||
queryParams.push(`tag_filter_type=${req.tagFilterType}`);
|
||||
if (req.tagFilter) {
|
||||
queryParams.push(`tag_filter=${encodeURIComponent(req.tagFilter)}`);
|
||||
}
|
||||
|
||||
if (req.keyword) {
|
||||
@@ -524,12 +523,8 @@ export default {
|
||||
queryParams.push(`end_year_month=${req.endYearMonth}`);
|
||||
}
|
||||
|
||||
if (req.tagIds) {
|
||||
queryParams.push(`tag_ids=${req.tagIds}`);
|
||||
}
|
||||
|
||||
if (req.tagFilterType) {
|
||||
queryParams.push(`tag_filter_type=${req.tagFilterType}`);
|
||||
if (req.tagFilter) {
|
||||
queryParams.push(`tag_filter=${encodeURIComponent(req.tagFilter)}`);
|
||||
}
|
||||
|
||||
if (req.keyword) {
|
||||
|
||||
Reference in New Issue
Block a user