根据需求调整links 返回,调整links删除查询
This commit is contained in:
parent
d758b367b1
commit
b0ecc0a30b
|
@ -11,8 +11,11 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@link = @issue.pm_links.find params[:id]
|
@link = @issue.pm_links.find_by(be_linkable_type: 'Issue', be_linkable_id: params[:id])
|
||||||
@link.destroy
|
if @link.try(:destroy)
|
||||||
render_ok
|
render_ok
|
||||||
|
else
|
||||||
|
render_error('删除失败!')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
|
|
||||||
json.links @links.each do |link|
|
json.issues @links.each do |link|
|
||||||
json.id link.id
|
json.partial! "api/v1/issues/simple_detail", locals: { issue: link.be_linkable }
|
||||||
json.issue do
|
|
||||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: link.be_linkable}
|
|
||||||
end
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue