Skip to content

Commit

Permalink
use the endpoint '/search/agents' for the agents search input component
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Jul 22, 2024
1 parent 5e82b7a commit 737f1b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/controllers/agents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def show

def ajax_agents
filters = { query: params[:query]}
@agents = LinkedData::Client::Models::Agent.all(filters)
agents_json = @agents.map do |x|
@agents = LinkedData::Client::HTTP.get('/search/agents', filters)
agents_json = @agents.collection.map do |x|
{
id: x.id,
name: x.name,
type: x.agentType,
identifiers: x.identifiers.map { |i| "#{i.schemaAgency}:#{i.notation}" }.join(', '),
acronym: x.acronym
id: x.resource_id,
name: x.name_text,
type: x.agentType_t,
identifiers: x.identifiers_texts&.join(', '),
acronym: x.acronym_text
}
end

Expand Down

0 comments on commit 737f1b9

Please sign in to comment.