This commit is contained in:
parent
8902e265b4
commit
b87eb8ea14
2 changed files with 8 additions and 0 deletions
|
@ -10,6 +10,10 @@ class FavouriteService < BaseService
|
|||
def call(account, status)
|
||||
authorize_with account, status, :show?
|
||||
|
||||
favourite = Favourite.find_by(account: account, status: status)
|
||||
|
||||
return favourite unless favourite.nil?
|
||||
|
||||
favourite = Favourite.create!(account: account, status: status)
|
||||
|
||||
if status.local?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue