change
This commit is contained in:
parent
26e1592d93
commit
8a7464cf6c
|
@ -110,7 +110,6 @@ class IssuesController < ApplicationController
|
||||||
issue_params = issue_send_params(params)
|
issue_params = issue_send_params(params)
|
||||||
|
|
||||||
@issue = Issue.new(issue_params)
|
@issue = Issue.new(issue_params)
|
||||||
begin
|
|
||||||
if @issue.save!
|
if @issue.save!
|
||||||
if params[:attachment_ids].present?
|
if params[:attachment_ids].present?
|
||||||
params[:attachment_ids].each do |id|
|
params[:attachment_ids].each do |id|
|
||||||
|
@ -141,23 +140,10 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
@issue.project_trends.create(user_id: current_user.id, project_id: @project.id, action_type: "create")
|
@issue.project_trends.create(user_id: current_user.id, project_id: @project.id, action_type: "create")
|
||||||
normal_status(0, "创建成功")
|
render json: {status: 0, message: "创建成", id: @issue.id}
|
||||||
else
|
else
|
||||||
normal_status(-1, "创建失败")
|
normal_status(-1, "创建失败")
|
||||||
end
|
end
|
||||||
if params[:assigned_to_id].present?
|
|
||||||
Tiding.create!(user_id: params[:assigned_to_id], trigger_user_id: current_user.id,
|
|
||||||
container_id: @issue.id, container_type: 'Issue',
|
|
||||||
parent_container_id: @project.id, parent_container_type: "Project",
|
|
||||||
tiding_type: 'issue', status: 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
@issue.project_trends.create(user_id: current_user.id, project_id: @project.id, action_type: "create")
|
|
||||||
# normal_status(0, "创建成功",)
|
|
||||||
render :json => { status: 0, message: "创建成功", id: @issue.id}
|
|
||||||
else
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue