Skip to content

Commit

Permalink
adapt to hasDebt flag (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf authored Dec 9, 2024
1 parent 3060527 commit 1fa1c5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/controllers/account-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ `
$includeChildrenTransactions: Boolean
$includeHost: Boolean
$isRefund: Boolean
$hasDebt: Boolean
$kind: [TransactionKind]
$limit: Int
$maxAmount: Int
Expand Down Expand Up @@ -282,6 +283,7 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ `
includeDebts: true
includeHost: $includeHost
isRefund: $isRefund
hasDebt: $hasDebt
kind: $kind
limit: $limit
maxAmount: $maxAmount
Expand Down Expand Up @@ -449,6 +451,7 @@ const accountTransactions: RequestHandler<Params> = async (req, res) => {
'expenseId',
'expenseType',
'group',
'hasDebt',
'includeChildrenTransactions',
'includeGiftCardTransactions',
'includeHost',
Expand Down Expand Up @@ -598,6 +601,11 @@ const accountTransactions: RequestHandler<Params> = async (req, res) => {
variables.isRefund = parseToBooleanDefaultFalse(variables.isRefund);
}

// hasDebt can be false but default should be undefined
if (!isNil(variables.hasDebt)) {
variables.hasDebt = parseToBooleanDefaultFalse(variables.hasDebt);
}

if (req.query.fullDescription) {
variables.fullDescription = parseToBooleanDefaultFalse(req.query.fullDescription as string);
} else {
Expand Down

0 comments on commit 1fa1c5d

Please sign in to comment.