chore: cleanup
This commit is contained in:
@@ -29,17 +29,6 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
||||
end
|
||||
end
|
||||
|
||||
def create_comment
|
||||
issue_id = params[:issue_id]
|
||||
comment = permitted_params[:comment]
|
||||
issue = linear_processor_service.create_comment(issue_id, comment)
|
||||
if issue.is_a?(Hash) && issue[:error]
|
||||
render json: { error: issue[:error] }, status: :unprocessable_entity
|
||||
else
|
||||
render json: issue, status: :ok
|
||||
end
|
||||
end
|
||||
|
||||
def link_issue
|
||||
issue_id = params[:issue_id]
|
||||
issue = linear_processor_service.link_issue(conversation_link, issue_id)
|
||||
|
||||
@@ -233,7 +233,6 @@ Rails.application.routes.draw do
|
||||
get :team_entities
|
||||
post :create_issue
|
||||
post :link_issue
|
||||
post :create_comment
|
||||
post :unlink_issue
|
||||
get :search_issue
|
||||
get :linked_issue
|
||||
|
||||
@@ -41,17 +41,6 @@ class Integrations::Linear::ProcessorService
|
||||
}
|
||||
end
|
||||
|
||||
def create_comment(issue_id, comment)
|
||||
response = linear_client.create_comment(issue_id, comment)
|
||||
|
||||
return response if response[:error]
|
||||
|
||||
{
|
||||
id: response['commentCreate']['comment']['id'],
|
||||
body: response['commentCreate']['comment']['body']
|
||||
}
|
||||
end
|
||||
|
||||
def unlink_issue(link_id)
|
||||
response = linear_client.unlink_issue(link_id)
|
||||
return response if response[:error]
|
||||
|
||||
@@ -66,20 +66,6 @@ class Linear
|
||||
process_response(response)
|
||||
end
|
||||
|
||||
def create_comment(issue_id, body)
|
||||
raise ArgumentError, 'Missing issue id' if issue_id.blank?
|
||||
raise ArgumentError, 'Missing body' if body.blank?
|
||||
|
||||
variables = {
|
||||
issueId: issue_id,
|
||||
body: body
|
||||
}
|
||||
|
||||
mutation = LinearMutations.create_comment(variables)
|
||||
response = post({ query: mutation })
|
||||
process_response(response)
|
||||
end
|
||||
|
||||
def link_issue(link, issue_id)
|
||||
raise ArgumentError, 'Missing link' if link.blank?
|
||||
raise ArgumentError, 'Missing issue id' if issue_id.blank?
|
||||
|
||||
@@ -31,20 +31,6 @@ module LinearMutations
|
||||
GRAPHQL
|
||||
end
|
||||
|
||||
def self.create_comment(input)
|
||||
<<~GRAPHQL
|
||||
mutation {
|
||||
commentCreate(input: { #{graphql_input(input)} }) {
|
||||
success
|
||||
comment {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
}
|
||||
GRAPHQL
|
||||
end
|
||||
|
||||
def self.issue_link(issue_id, link)
|
||||
<<~GRAPHQL
|
||||
mutation {
|
||||
|
||||
@@ -53,7 +53,6 @@ module LinearQueries
|
||||
id
|
||||
title
|
||||
description
|
||||
identifier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user