Skip to content

Commit

Permalink
Add filter options to host transactions export (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavlrsn authored Dec 20, 2023
1 parent d75a9b1 commit ab9bdb6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/server/controllers/account-transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ `
$dateTo: DateTime
$minAmount: Int
$maxAmount: Int
$searchTerm: String
$includeChildrenTransactions: Boolean
$includeHost: Boolean
$fetchHostFee: Boolean
$fetchPaymentProcessorFee: Boolean
$fullDescription: Boolean
Expand All @@ -200,6 +203,9 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ `
dateTo: $dateTo
minAmount: $minAmount
maxAmount: $maxAmount
searchTerm: $searchTerm
includeChildrenTransactions: $includeChildrenTransactions
includeHost: $includeHost
) {
...TransactionsFragment
}
Expand Down Expand Up @@ -369,6 +375,7 @@ const accountTransactions = async (req, res) => {
'includeChildrenTransactions',
'includeGiftCardTransactions',
'includeRegularTransactions',
'includeHost',
]);
variables.limit =
// If HEAD, we only want count, so we set limit to 0
Expand Down Expand Up @@ -432,6 +439,10 @@ const accountTransactions = async (req, res) => {
variables.includeRegularTransactions = parseToBooleanDefaultTrue(variables.includeRegularTransactions);
}

if (variables.includeHost) {
variables.includeHost = parseToBooleanDefaultTrue(variables.includeHost);
}

variables.fetchHostFee = parseToBooleanDefaultFalse(req.query.flattenHostFee);
if (variables.fetchHostFee) {
variables.kind = difference(variables.kind || allKinds, ['HOST_FEE']);
Expand Down

0 comments on commit ab9bdb6

Please sign in to comment.