修复:更新issue protrend未正常创建错误

This commit is contained in:
yystopf 2024-10-12 15:03:43 +08:00
parent 9ac8bac777
commit 359f1c40f6
2 changed files with 2 additions and 2 deletions

View File

@ -172,7 +172,7 @@ class Api::Pm::Issues::UpdateService < ApplicationService
def build_issue_project_trends
if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][1] == 5
@updated_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE})
@updated_issue.project_trends.create!({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE})
end
if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][0] == 5
@updated_issue.project_trends.where(action_type: ProjectTrend::CLOSE).each(&:destroy!)

View File

@ -172,7 +172,7 @@ class Api::V1::Issues::UpdateService < ApplicationService
def build_issue_project_trends
if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][1] == 5
@updated_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE})
@updated_issue.project_trends.create!({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE})
end
if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][0] == 5
@updated_issue.project_trends.where(action_type: ProjectTrend::CLOSE).each(&:destroy!)