Skip to content

Commit 83f6c29

Browse files
committed
feat: add provider_id filtering to ReferenceRepository and update tests
1 parent 46a7e33 commit 83f6c29

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

app/models/reference_repository.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ def filter(options)
355355
"repository_type": options[:repository_type].split(",")
356356
} }
357357
end
358+
if options[:provider_id].present?
359+
retval << { term: {
360+
"provider_id": { value: options[:provider_id], case_insensitive: true }
361+
} }
362+
end
358363
if options[:is_open] == "true"
359364
retval << { term: {
360365
"data_access.type": "open"

spec/requests/repositories_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def reset_indices
1616
clear_index(DataciteDoi)
1717
clear_index(Client)
1818
clear_index(Provider)
19+
clear_index(ReferenceRepository)
20+
import_index(ReferenceRepository)
1921
import_index(Provider)
2022
import_index(Client)
2123
import_index(DataciteDoi)

0 commit comments

Comments
 (0)