issue links

This commit is contained in:
呱呱呱
2023-11-07 17:16:25 +08:00
parent 00448f0f01
commit c752671453
15 changed files with 150 additions and 31 deletions

View File

@@ -0,0 +1,25 @@
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
@link = @issue.pm_links.find_or_create_by(be_linkable_type: 'Issue', be_linkable_id: params[:link_id])
data = {
data: {
id: @link.id,
issue_id: @link.linkable_id,
linked_issue_id: @link.be_linkable_id
}
}
render_ok(data)
end
def destroy
@link = @issue.pm_links.find params[:id]
@link.destroy
render_ok
end
end