From b381cf20d66632084c7363b312fec138bd61aff8 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 19 Feb 2020 21:25:23 -0700 Subject: [PATCH] Fix transaction filtering by budgets --- .../wbrawner/budgetserver/transaction/TransactionController.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt b/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt index fd392d7..1756645 100644 --- a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt +++ b/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionController.kt @@ -47,8 +47,9 @@ open class TransactionController( @RequestParam sortOrder: Sort.Direction? ): ResponseEntity> { val budgets = if (budgetIds != null) { - userPermissionsRepository.findAllByUser( + userPermissionsRepository.findAllByUserAndBudget_IdIn( user = getCurrentUser()!!, + budgetIds = budgetIds.toList(), pageable = PageRequest.of(page ?: 0, count ?: 1000)) } else { userPermissionsRepository.findAllByUser(getCurrentUser()!!, null)