Skip to content

Commit

Permalink
Merge pull request #998 from ElixirTeSS/remove-json-ext
Browse files Browse the repository at this point in the history
Strip `.json` extension from URLs returned from API endpoints
  • Loading branch information
fbacall committed Jul 18, 2024
2 parents 6cd1508 + b8fafc3 commit debd784
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/views/collections/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
json.array!(@collections) do |collection|
json.extract! collection, :id, :title, :description, :image_url
json.url collection_url(collection, format: :json)
json.url collection_url(collection)
end
2 changes: 1 addition & 1 deletion app/views/content_providers/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
json.array!(@content_providers) do |content_provider|
json.extract! content_provider, :id, :id, :title, :image_url, :description,
:url, :created_at, :updated_at, :contact
json.url content_provider_url(content_provider, format: :json)
json.url content_provider_url(content_provider)
end
2 changes: 1 addition & 1 deletion app/views/learning_path_topics/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
json.array!(@learning_path_topics) do |learning_path_topic|
json.extract! learning_path_topic, :id, :title, :description
json.url learning_path_topic_url(learning_path_topic, format: :json)
json.url learning_path_topic_url(learning_path_topic)
end
2 changes: 1 addition & 1 deletion app/views/materials/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
json.array!(@materials) do |material|
json.extract! material, :id, :title, :url, :description, :doi, :remote_updated_date, :remote_created_date
json.url material_url(material, format: :json)
json.url material_url(material)

json.partial! 'common/ontology_terms', type: 'scientific_topics', resource: material
json.partial! 'common/ontology_terms', type: 'operations', resource: material
Expand Down
2 changes: 1 addition & 1 deletion app/views/nodes/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
json.array!(@nodes) do |node|
json.extract! node, :id, :title, :description, :image_url, :events, :materials, :created_at, :updated_at
json.url node_url(node, format: :json)
json.url node_url(node)
end
2 changes: 1 addition & 1 deletion app/views/sources/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
json.array!(@sources) do |source|
json.extract! source, :content_provider, :created_at, :url,
:method, :enabled
json.url source_url(source, format: :json)
json.url source_url(source)
end
2 changes: 1 addition & 1 deletion app/views/users/_list.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
json.array!(users) do |user|
json.extract! user, :id, :username
json.extract! user.profile, :firstname, :surname if user.profile
json.url user_url(user, format: :json)
json.url user_url(user)
end
2 changes: 1 addition & 1 deletion app/views/workflows/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
json.array!(@workflows) do |workflow|
json.extract! workflow, :id, :title, :description, :user_id, :workflow_content
json.url workflow_url(workflow, format: :json)
json.url workflow_url(workflow)

json.partial! 'common/ontology_terms', type: 'scientific_topics', resource: workflow
end

0 comments on commit debd784

Please sign in to comment.