mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 22:26:23 +00:00
fix: las actividades se pueden rechazar
This commit is contained in:
parent
7b8730c34c
commit
e733c45b63
2 changed files with 9 additions and 0 deletions
|
@ -47,6 +47,10 @@ module Api
|
||||||
# Cuando rechazamos una actividad, recibimos la confirmación y
|
# Cuando rechazamos una actividad, recibimos la confirmación y
|
||||||
# cambiamos el estado
|
# cambiamos el estado
|
||||||
def onrejected
|
def onrejected
|
||||||
|
ActivityPub.transaction do
|
||||||
|
activity_pub.reject! if activity_pub.waiting?
|
||||||
|
end
|
||||||
|
|
||||||
head :accepted
|
head :accepted
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -53,5 +53,10 @@ class ActivityPub < ApplicationRecord
|
||||||
event :approve do
|
event :approve do
|
||||||
transitions from: :waiting, to: :approved
|
transitions from: :waiting, to: :approved
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# La actividad fue rechazada
|
||||||
|
event :reject do
|
||||||
|
transitions from: :waiting, to: :rejected
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue