Skip to content

Commit

Permalink
Merge pull request #1602 from tvdeyen/fix-ams-root-key-4.2
Browse files Browse the repository at this point in the history
Use strings as JSON root keys in API controllers
  • Loading branch information
tvdeyen authored Aug 8, 2019
2 parents 5c877c1 + af191bc commit 0ab902d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/alchemy/api/contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def index
if params[:element_id].present?
@contents = @contents.where(element_id: params[:element_id])
end
render json: @contents, adapter: :json, root: :contents
render json: @contents, adapter: :json, root: 'contents'
end

# Returns a json object for content
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/alchemy/api/elements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def index
if params[:named].present?
@elements = @elements.named(params[:named])
end
render json: @elements, adapter: :json, root: :elements
render json: @elements, adapter: :json, root: 'elements'
end

# Returns a json object for element
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/alchemy/api/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def index
if params[:page_layout].present?
@pages = @pages.where(page_layout: params[:page_layout])
end
render json: @pages, adapter: :json, root: :pages
render json: @pages, adapter: :json, root: 'pages'
end

# Returns all pages as nested json object for tree views
Expand Down

0 comments on commit 0ab902d

Please sign in to comment.