diff options
Diffstat (limited to 'app/services/pages/delete_service.rb')
-rw-r--r-- | app/services/pages/delete_service.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/pages/delete_service.rb b/app/services/pages/delete_service.rb index 8d33e6c1000..95e99daeb6c 100644 --- a/app/services/pages/delete_service.rb +++ b/app/services/pages/delete_service.rb @@ -11,7 +11,20 @@ module Pages # > The default strategy is :nullify which sets the foreign keys to NULL. PagesDomain.for_project(project).delete_all + publish_deleted_event + DestroyPagesDeploymentsWorker.perform_async(project.id) end + + private + + def publish_deleted_event + event = Pages::PageDeletedEvent.new(data: { + project_id: project.id, + namespace_id: project.namespace_id + }) + + Gitlab::EventStore.publish(event) + end end end |