2018-07-18 12:03:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-12-20 08:32:43 -05:00
|
|
|
module WikiPages
|
|
|
|
class DestroyService < WikiPages::BaseService
|
|
|
|
def execute(page)
|
|
|
|
if page&.delete
|
2020-03-24 08:09:42 -04:00
|
|
|
execute_hooks(page)
|
2016-12-20 08:32:43 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
page
|
|
|
|
end
|
2020-03-24 08:09:42 -04:00
|
|
|
|
|
|
|
def usage_counter_action
|
|
|
|
:delete
|
|
|
|
end
|
|
|
|
|
|
|
|
def external_action
|
|
|
|
'delete'
|
|
|
|
end
|
|
|
|
|
|
|
|
def event_action
|
|
|
|
Event::DESTROYED
|
|
|
|
end
|
2016-12-20 08:32:43 -05:00
|
|
|
end
|
|
|
|
end
|