Browse Source

修复进入关联子项后删除关联失败问题

pull/347/head
kingChan 2 years ago
parent
commit
fe924527ec
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      app/controllers/api/pm/issue_links_controller.rb

+ 3
- 1
app/controllers/api/pm/issue_links_controller.rb View File

@@ -11,7 +11,9 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
end

def destroy
@link = @issue.pm_links.find_by(be_linkable_type: 'Issue', be_linkable_id: params[:id])
params ={"pm_project_id":"17", "issue_id":"4279", "id":3117}
@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)
render_ok
else


Loading…
Cancel
Save