Make tag following idempotent (#20860)

local
trwnh 2 years ago committed by GitHub
parent 72618ebf03
commit 7fdeed5fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/controllers/api/v1/tags_controller.rb

@ -12,7 +12,7 @@ class Api::V1::TagsController < Api::BaseController
end
def follow
TagFollow.create!(tag: @tag, account: current_account, rate_limit: true)
TagFollow.first_or_create!(tag: @tag, account: current_account, rate_limit: true)
render json: @tag, serializer: REST::TagSerializer
end

Loading…
Cancel
Save