mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 17:46:21 +00:00
feat: creado modulo BaseService para opcion de auto_publicacion #13244
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
823b191872
commit
331dc7f607
3 changed files with 9 additions and 0 deletions
5
app/services/base_service.rb
Normal file
5
app/services/base_service.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
module BaseService
|
||||
def auto_publish!
|
||||
DeployJob.perform_later site if site.auto_publish?
|
||||
end
|
||||
end
|
|
@ -3,6 +3,8 @@
|
|||
# Este servicio se encarga de crear artículos y guardarlos en git,
|
||||
# asignándoselos a une usuarie
|
||||
PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
|
||||
include BaseService
|
||||
|
||||
# Crea un artículo nuevo
|
||||
#
|
||||
# @return Post
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# Se encargar de guardar cambios en sitios
|
||||
# TODO: Implementar rollback en la configuración
|
||||
SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
||||
include BaseService
|
||||
|
||||
def deploy
|
||||
site.enqueue!
|
||||
DeployJob.perform_later site.id
|
||||
|
|
Loading…
Reference in a new issue