Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use strings as JSON root keys in API controllers #1602

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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