修复:atme和issue category 无法正常搜索
This commit is contained in:
parent
dab636d122
commit
2e0b32f86b
|
@ -109,7 +109,7 @@ class Api::V1::Issues::CreateService < ApplicationService
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_atme_participants
|
def build_atme_participants
|
||||||
atme_receivers.each do |receiver|
|
@atme_receivers.each do |receiver|
|
||||||
@created_issue.issue_participants.new({participant_type: "atme", participant_id: receiver.id})
|
@created_issue.issue_participants.new({participant_type: "atme", participant_id: receiver.id})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,13 +28,13 @@ class Api::V1::Issues::ListService < ApplicationService
|
||||||
|
|
||||||
def call
|
def call
|
||||||
raise Error, errors.full_messages.join(", ") unless valid?
|
raise Error, errors.full_messages.join(", ") unless valid?
|
||||||
begin
|
# begin
|
||||||
issue_query_data
|
issue_query_data
|
||||||
|
|
||||||
return {data: queried_issues, total_issues_count: @total_issues_count, closed_issues_count: @closed_issues_count, opened_issues_count: @opened_issues_count}
|
return {data: queried_issues, total_issues_count: @total_issues_count, closed_issues_count: @closed_issues_count, opened_issues_count: @opened_issues_count}
|
||||||
rescue
|
# rescue
|
||||||
raise Error, "服务器错误,请联系系统管理员!"
|
# raise Error, "服务器错误,请联系系统管理员!"
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -43,13 +43,13 @@ class Api::V1::Issues::ListService < ApplicationService
|
||||||
|
|
||||||
case participant_category
|
case participant_category
|
||||||
when 'aboutme' # 关于我的
|
when 'aboutme' # 关于我的
|
||||||
issues = issues.joins(:participants, :issue_participants).where(issue_participants: {participant_type: %(authored assigned atme)},users: {id: current_user&.id})
|
issues = issues.joins(:issue_participants).where(issue_participants: {participant_type: %(authored assigned atme), participant_id: current_user&.id})
|
||||||
when 'authoredme' # 我创建的
|
when 'authoredme' # 我创建的
|
||||||
issues = issues.joins(:participants, :issue_participants).where(issue_participants: {participant_type: 'assigned'},users: {id: current_user&.id})
|
issues = issues.joins(:issue_participants).where(issue_participants: {participant_type: 'authored', participant_id: current_user&.id})
|
||||||
when 'assignedme' # 我负责的
|
when 'assignedme' # 我负责的
|
||||||
issues = issues.joins(:participants, :issue_participants).where(issue_participants: {participant_type: 'assigned'},users: {id: current_user&.id})
|
issues = issues.joins(:issue_participants).where(issue_participants: {participant_type: 'assigned', participant_id: current_user&.id})
|
||||||
when 'atme' # @我的
|
when 'atme' # @我的
|
||||||
issues = issues.joins(:participants, :issue_participants).where(issue_participants: {participant_type: 'atme'},users: {id: current_user&.id})
|
issues = issues.joins(:issue_participants).where(issue_participants: {participant_type: 'atme', participant_id: current_user&.id})
|
||||||
end
|
end
|
||||||
|
|
||||||
# author_id
|
# author_id
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Api::V1::Issues::UpdateService < ApplicationService
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_atme_participants
|
def build_atme_participants
|
||||||
atme_receivers.each do |receiver|
|
@atme_receivers.each do |receiver|
|
||||||
next if @updated_issue.issue_participants.exists?(participant_type: "atme", participant_id: receiver.id)
|
next if @updated_issue.issue_participants.exists?(participant_type: "atme", participant_id: receiver.id)
|
||||||
@updated_issue.issue_participants.new({participant_type: "atme", participant_id: receiver.id})
|
@updated_issue.issue_participants.new({participant_type: "atme", participant_id: receiver.id})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue