根据需求调整links 返回,调整links删除查询
This commit is contained in:
parent
d758b367b1
commit
b0ecc0a30b
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue