19 lines
451 B
Ruby
19 lines
451 B
Ruby
class Api::Pm::IssueLinksController < Api::Pm::BaseController
|
|
before_action :load_project
|
|
before_action :load_issue
|
|
def index
|
|
@links = @issue.pm_links.where(be_linkable_type: 'Issue')
|
|
end
|
|
|
|
def create
|
|
params[:link_ids].map { |e| @issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: e) }
|
|
render_ok
|
|
end
|
|
|
|
def destroy
|
|
@link = @issue.pm_links.find params[:id]
|
|
@link.destroy
|
|
render_ok
|
|
end
|
|
end
|