Merge pull request '修复进入关联子项后删除关联失败问题' (#317) from KingChan/forgeplus:pm_project_develop into pm_project_develop

This commit is contained in:
KingChan 2024-06-27 15:43:58 +08:00
commit f70cbc09b4
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,8 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
end end
def destroy def destroy
@link = @issue.pm_links.find_by(be_linkable_type: 'Issue', be_linkable_id: params[:id]) @links = PmLink.where(be_linkable_id: @issue.id, be_linkable_type: 'Issue', linkable_id: params[:id], linkable_type: 'Issue').or(PmLink.where(linkable_id: @issue.id, linkable_type: 'Issue', be_linkable_id: params[:id], be_linkable_type: 'Issue'))
@link = @links.last
if @link.try(:destroy) if @link.try(:destroy)
render_ok render_ok
else else