Skip to content

Commit

Permalink
force to downcase agent id to fix issues the id that contains Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jun 15, 2023
1 parent 76db662 commit 9e5059f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/agents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AgentsController < ApplicationController

# Update an existing submission of a agent
patch '/:id' do
acronym = params["id"]
acronym = params["id"].downcase
agent = LinkedData::Models::Agent.find(acronym).include(LinkedData::Models::Agent.attributes).first

if agent.nil?
Expand All @@ -61,7 +61,7 @@ class AgentsController < ApplicationController

# Delete a agent
delete '/:id' do
agent = LinkedData::Models::Agent.find(params["id"]).first
agent = LinkedData::Models::Agent.find(params["id"].downcase).first
agent.delete
halt 204
end
Expand Down

0 comments on commit 9e5059f

Please sign in to comment.