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

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-06 18:43:05 +00:00
commit 0d5298fc2d
2 changed files with 4 additions and 3 deletions

View file

@ -53,7 +53,8 @@ module Api
instance.present?
object.present?
activity.present?
activity_pub.approve! if activity_pub.may_approve?
activity_pub.update(aasm_state: 'approved')
activity.update_activity_pub_state!
end
head :accepted
@ -69,7 +70,7 @@ module Api
instance.present?
object.present?
activity.present?
activity_pub.reject! if activity_pub.may_reject?
activity_pub.update(aasm_state: 'rejected')
end
head :accepted

View file

@ -18,7 +18,7 @@ class ActivityPub < ApplicationRecord
belongs_to :site
belongs_to :object, polymorphic: true
belongs_to :actor
belongs_to :remote_flag, class_name: 'ActivityPub::RemoteFlag'
belongs_to :remote_flag, optional: true, class_name: 'ActivityPub::RemoteFlag'
has_many :activities
validates :site_id, presence: true