将issue_links接口改为支持数组类型
This commit is contained in:
parent
a474934391
commit
be45e45dbc
|
@ -6,15 +6,8 @@ class Api::Pm::IssueLinksController < Api::Pm::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@link = @issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: params[:link_id])
|
params[:link_ids].map { |e| @issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: e) }
|
||||||
data = {
|
render_ok
|
||||||
data: {
|
|
||||||
id: @link.id,
|
|
||||||
issue_id: @link.linkable_id,
|
|
||||||
linked_issue_id: @link.be_linkable_id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
render_ok(data)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
Loading…
Reference in New Issue