Skip to content
Snippets Groups Projects
Commit e6f79e0a authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

fix add_object to collection method

parent 9a60edd3
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ class V1::CollectionsController < ApplicationController
def add_object
render nothing: true, status: :unprocessable_entity if params.nil?
items = params[:items]
items = collection_params[:items]
items.each do |item|
order = item[:order]
......@@ -87,7 +87,7 @@ class V1::CollectionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def collection_params
params.require(:collection).permit(:name, :description, :owner_id, :owner_type, :privacy, tags: [], items: [])
params.require(:collection).permit(:name, :description, :owner_id, :owner_type, :privacy, tags: [], items: [:type, :id])
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment