Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #71 from pvdthings/fix-loan-details-provider
Browse files Browse the repository at this point in the history
Select the loan with same ID and thing ID
  • Loading branch information
dillonfagan authored Oct 19, 2023
2 parents 760b2ae + 6b1e7f8 commit 4c97400
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/features/loans/providers/loan_details_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ final loanDetailsProvider = Provider<Future<LoanModel?>>((ref) async {
}

final loans = await ref.watch(loansRepositoryProvider);
return loans.firstWhereOrNull((loan) => loan.id == selectedLoan.id);
return loans.firstWhereOrNull((loan) =>
loan.id == selectedLoan.id && loan.thing.id == selectedLoan.thing.id);
});

0 comments on commit 4c97400

Please sign in to comment.