mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 19:36:21 +00:00
feat: aprobar o rechazar actividades
This commit is contained in:
parent
b798980865
commit
ccd3df2038
1 changed files with 13 additions and 1 deletions
|
@ -64,14 +64,26 @@ class ActivityPub < ApplicationRecord
|
|||
transitions from: %i[approved rejected], to: :paused
|
||||
end
|
||||
|
||||
# La actividad se aprueba
|
||||
# La actividad se aprueba, informándole a la Social Inbox que está
|
||||
# aprobada. También recibimos la aprobación via
|
||||
# webhook a modo de confirmación.
|
||||
event :approve do
|
||||
transitions from: %i[paused rejected], to: :approved
|
||||
|
||||
before do
|
||||
raise AASM::InvalidTransition unless
|
||||
site.social_inbox.inbox.accept(id: object.uri).ok?
|
||||
end
|
||||
end
|
||||
|
||||
# La actividad fue rechazada
|
||||
event :reject do
|
||||
transitions from: %i[paused approved], to: :rejected
|
||||
|
||||
before do
|
||||
raise AASM::InvalidTransition unless
|
||||
site.social_inbox.inbox.reject(id: object.uri).ok?
|
||||
end
|
||||
end
|
||||
|
||||
# Solo podemos reportarla luego de rechazarla
|
||||
|
|
Loading…
Reference in a new issue