Commit a41fa5f8 authored by Sean Arnold's avatar Sean Arnold

Seperate create params from update params

parent 9d01d1b5
...@@ -90,7 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -90,7 +90,7 @@ class Projects::IssuesController < Projects::ApplicationController
params[:issue] ||= ActionController::Parameters.new( params[:issue] ||= ActionController::Parameters.new(
assignee_ids: "" assignee_ids: ""
) )
build_params = issue_params.merge( build_params = issue_create_params.merge(
merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of], merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of],
discussion_to_resolve: params[:discussion_to_resolve], discussion_to_resolve: params[:discussion_to_resolve],
confidential: !!Gitlab::Utils.to_boolean(params[:issue][:confidential]) confidential: !!Gitlab::Utils.to_boolean(params[:issue][:confidential])
...@@ -110,7 +110,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -110,7 +110,7 @@ class Projects::IssuesController < Projects::ApplicationController
end end
def create def create
create_params = issue_params.merge(spammable_params).merge( create_params = issue_create_params.merge(spammable_params).merge(
merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of], merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of],
discussion_to_resolve: params[:discussion_to_resolve] discussion_to_resolve: params[:discussion_to_resolve]
) )
...@@ -290,10 +290,19 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -290,10 +290,19 @@ class Projects::IssuesController < Projects::ApplicationController
task_num task_num
lock_version lock_version
discussion_locked discussion_locked
issue_type
] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }] ] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }]
end end
def issue_create_params
create_params = %i[
issue_type
]
params.require(:issue).permit(
*create_params
).merge(issue_params)
end
def reorder_params def reorder_params
params.permit(:move_before_id, :move_after_id, :group_full_path) params.permit(:move_before_id, :move_after_id, :group_full_path)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment