Skip to content

Commit a1f30b2

Browse files
DianaLiaocompwron
authored andcommitted
[6199] add filter to case_contacts to only include volunteer's current cases
1 parent 12fd1f1 commit a1f30b2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/controllers/case_contacts_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def index
2121

2222
@pagy, @filtered_case_contacts = pagy(@filterrific.find)
2323
case_contacts = CaseContact.case_hash_from_cases(@filtered_case_contacts)
24+
case_contacts = case_contacts.select { |k, _v| current_user.casa_cases.pluck(:id).include?(k) } if current_user.volunteer?
2425
case_contacts = case_contacts.select { |k, _v| k == params[:casa_case_id].to_i } if params[:casa_case_id].present?
2526

2627
@presenter = CaseContactPresenter.new(case_contacts)

0 commit comments

Comments
 (0)