From 1fa1c5d42dd15b12955895cff4db449062f637ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Hodierne?= Date: Mon, 9 Dec 2024 16:45:35 +0100 Subject: [PATCH] adapt to hasDebt flag (#583) --- src/server/controllers/account-transactions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/controllers/account-transactions.ts b/src/server/controllers/account-transactions.ts index ab574b2d..14fe0a07 100644 --- a/src/server/controllers/account-transactions.ts +++ b/src/server/controllers/account-transactions.ts @@ -253,6 +253,7 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ ` $includeChildrenTransactions: Boolean $includeHost: Boolean $isRefund: Boolean + $hasDebt: Boolean $kind: [TransactionKind] $limit: Int $maxAmount: Int @@ -282,6 +283,7 @@ const hostTransactionsQuery = gqlV2/* GraphQL */ ` includeDebts: true includeHost: $includeHost isRefund: $isRefund + hasDebt: $hasDebt kind: $kind limit: $limit maxAmount: $maxAmount @@ -449,6 +451,7 @@ const accountTransactions: RequestHandler = async (req, res) => { 'expenseId', 'expenseType', 'group', + 'hasDebt', 'includeChildrenTransactions', 'includeGiftCardTransactions', 'includeHost', @@ -598,6 +601,11 @@ const accountTransactions: RequestHandler = 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 {