2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ErrorTracking
|
2019-12-26 22:10:19 +05:30
|
|
|
class ListIssuesService < ErrorTracking::BaseService
|
2019-02-15 15:39:39 +05:30
|
|
|
DEFAULT_ISSUE_STATUS = 'unresolved'
|
|
|
|
DEFAULT_LIMIT = 20
|
|
|
|
|
|
|
|
def external_url
|
|
|
|
project_error_tracking_setting&.sentry_external_url
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
def fetch
|
|
|
|
project_error_tracking_setting.list_sentry_issues(issue_status: issue_status, limit: limit)
|
2019-07-07 11:18:12 +05:30
|
|
|
end
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
def parse_response(response)
|
|
|
|
{ issues: response[:issues] }
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def issue_status
|
|
|
|
params[:issue_status] || DEFAULT_ISSUE_STATUS
|
|
|
|
end
|
|
|
|
|
|
|
|
def limit
|
|
|
|
params[:limit] || DEFAULT_LIMIT
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|