根据需求调整links 返回,调整links删除查询

This commit is contained in:
呱呱呱 2023-11-15 11:11:00 +08:00
parent d758b367b1
commit b0ecc0a30b
2 changed files with 8 additions and 8 deletions

View File

@ -11,8 +11,11 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
end
def destroy
@link = @issue.pm_links.find params[:id]
@link.destroy
render_ok
@link = @issue.pm_links.find_by(be_linkable_type: 'Issue', be_linkable_id: params[:id])
if @link.try(:destroy)
render_ok
else
render_error('删除失败!')
end
end
end

View File

@ -1,7 +1,4 @@
json.links @links.each do |link|
json.id link.id
json.issue do
json.partial! "api/v1/issues/simple_detail", locals: {issue: link.be_linkable}
end
json.issues @links.each do |link|
json.partial! "api/v1/issues/simple_detail", locals: { issue: link.be_linkable }
end