5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 04:26:22 +00:00

feat: aprobar o rechazar actividades

This commit is contained in:
f 2024-03-04 16:46:43 -03:00
parent b798980865
commit ccd3df2038
No known key found for this signature in database

View file

@ -64,14 +64,26 @@ class ActivityPub < ApplicationRecord
transitions from: %i[approved rejected], to: :paused transitions from: %i[approved rejected], to: :paused
end 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 event :approve do
transitions from: %i[paused rejected], to: :approved transitions from: %i[paused rejected], to: :approved
before do
raise AASM::InvalidTransition unless
site.social_inbox.inbox.accept(id: object.uri).ok?
end
end end
# La actividad fue rechazada # La actividad fue rechazada
event :reject do event :reject do
transitions from: %i[paused approved], to: :rejected transitions from: %i[paused approved], to: :rejected
before do
raise AASM::InvalidTransition unless
site.social_inbox.inbox.reject(id: object.uri).ok?
end
end end
# Solo podemos reportarla luego de rechazarla # Solo podemos reportarla luego de rechazarla