diff options
Diffstat (limited to 'app/services/process_interaction_service.rb')
-rw-r--r-- | app/services/process_interaction_service.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb index e9c01103d..bd9afaf2e 100644 --- a/app/services/process_interaction_service.rb +++ b/app/services/process_interaction_service.rb @@ -108,12 +108,18 @@ class ProcessInteractionService < BaseService def favourite!(xml, from_account) current_status = status(xml) + + return if current_status.nil? + favourite = current_status.favourites.where(account: from_account).first_or_create!(account: from_account) NotifyService.new.call(current_status.account, favourite) end def unfavourite!(xml, from_account) current_status = status(xml) + + return if current_status.nil? + favourite = current_status.favourites.where(account: from_account).first favourite&.destroy end |