feat: add teams end point
This commit is contained in:
@@ -1,17 +1,27 @@
|
||||
class Integrations::Linear::ProcessorService
|
||||
pattr_initialize [:account!, :conversation!]
|
||||
|
||||
def create_issue; end
|
||||
def teams
|
||||
response = linear_client.teams
|
||||
return response if response[:error]
|
||||
|
||||
def link_issue; end
|
||||
response['teams']['nodes'].map(&:as_json)
|
||||
end
|
||||
|
||||
def list_issues
|
||||
issues = linear_client.list_issues
|
||||
issues.map(&:as_json)
|
||||
# get labels for a team
|
||||
def labels(team_id)
|
||||
response = linear_client.labels(team_id)
|
||||
return response if response[:error]
|
||||
|
||||
response['team']['labels']['nodes'].map(&:as_json)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def conversation_link
|
||||
"#{ENV.fetch('FRONTEND_URL', nil)}/app/accounts/#{account.id}/conversations/#{conversation.display_id}"
|
||||
end
|
||||
|
||||
def linear_hook
|
||||
@linear_hook ||= account.hooks.find_by!(app_id: 'linear')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user