Browse Source

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

pull/347/head
yystopf 1 year ago
parent
commit
359f1c40f6
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/services/api/pm/issues/update_service.rb
  2. +1
    -1
      app/services/api/v1/issues/update_service.rb

+ 1
- 1
app/services/api/pm/issues/update_service.rb 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!)


+ 1
- 1
app/services/api/v1/issues/update_service.rb 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!)


Loading…
Cancel
Save