feat: search issue API

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