blob: d5bed94d735bf0e643db3449ec2fbc19a1433c77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# frozen_string_literal: true
module Gitlab
module DatabaseImporters
module SelfMonitoring
module Project
class DeleteService < ::BaseService
include Stepable
include SelfMonitoring::Helpers
steps :validate_self_monitoring_project_exists,
:destroy_project
def initialize
super(nil)
end
def execute
execute_steps
end
private
def validate_self_monitoring_project_exists(result)
unless project_created? || self_monitoring_project_id.present?
return error(_('Self-monitoring project does not exist'))
end
success(result)
end
def destroy_project(result)
return success(result) unless project_created?
if self_monitoring_project.destroy
success(result)
else
log_error(self_monitoring_project.errors.full_messages)
error(_('Error deleting project. Check logs for error details.'))
end
end
end
end
end
end
end
|