Skip to content

Commit

Permalink
pass federation errors in federated search results
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Sep 27, 2024
1 parent 9299204 commit 58b8a9b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ontologies_api_client/models/class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ def self.search(*args)
search_result = federated_get(params) do |url|
"#{url}/search"
end

merged_collections = []
merged_collections = {results: [], errors: []}
search_result.each do |result|
merged_collections.concat(result.collection)
if result.collection
merged_collections[:results].concat(result.collection)
elsif result.errors
merged_collections[:errors] << result.errors
end
end
merged_collections
else
Expand Down

0 comments on commit 58b8a9b

Please sign in to comment.