there is no planning_element_type anymore when creating work_packages in v2

pull/485/head
Philipp Tessenow 11 years ago committed by Hagen Schink
parent 87717b2ba7
commit 87d9f6134d
  1. 10
      app/controllers/api/v2/planning_elements_controller.rb

@ -59,14 +59,7 @@ module Api
end
def create
planning_element_params = permitted_params.planning_element.tap do |p|
# map the old planning_element_type_id on the type_id of workpackage
p[:type_id] = p[:planning_element_type_id]
# and remove it from the params
p.except!(:planning_element_type_id)
end
@planning_element = planning_element_scope.new(planning_element_params)
@planning_element = planning_element_scope.new(permitted_params.planning_element)
# The planning_element inherits from workpackage, which requires an author.
# Using the current_user also satisfies this demand for API-calls
@ -74,7 +67,6 @@ module Api
successfully_created = @planning_element.save
respond_to do |format|
format.api do
if successfully_created
redirect_url = api_v2_project_planning_element_url(

Loading…
Cancel
Save