Skip to content

Commit

Permalink
Raise 404 for invalid source or target ontologies
Browse files Browse the repository at this point in the history
Fixes #210
  • Loading branch information
jvendetti committed Apr 17, 2023
1 parent 3e1e797 commit ee324c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/mappings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ def count
end

def show
page = params[:page] || 1
@ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:id]).first
not_found if @ontology.nil?

@target_ontology = LinkedData::Client::Models::Ontology.find(params[:target])
ontologies = [@ontology.acronym, @target_ontology.acronym]
not_found if @target_ontology.nil?

page = params[:page] || 1
ontologies = [@ontology.acronym, @target_ontology.acronym]
@mapping_pages = LinkedData::Client::HTTP.get(MAPPINGS_URL, {page: page, ontologies: ontologies.join(",")})
@mappings = @mapping_pages.collection
@delete_mapping_permission = check_delete_mapping_permission(@mappings)
Expand Down

0 comments on commit ee324c0

Please sign in to comment.