Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hasDebt flag #583

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading