feat: add linked issue api

This commit is contained in:
Muhsin Keloth
2024-05-09 22:40:42 +05:30
parent 5e1dbfb64d
commit 4645e57e9a
8 changed files with 134 additions and 0 deletions
@@ -49,6 +49,19 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
end
end
def linked_issue
render json: { error: 'Specify link with parameter link' }, status: :unprocessable_entity if params[:link].blank? && return
url = params[:link]
issues = linear_processor_service.linked_issue(url)
if issues.is_a?(Hash) && issues[:error]
render json: { error: issues[:error] }, status: :unprocessable_entity
else
render json: issues, status: :ok
end
end
def search_issue
render json: { error: 'Specify search string with parameter q' }, status: :unprocessable_entity if params[:q].blank? && return