Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 6b9e03e0 rédigé par Eugen Rochko's avatar Eugen Rochko Validation de GitHub
Parcourir les fichiers

Add API method to remove a suggestion (#7978)

DELETE /api/v1/suggestions/:account_id

When blocking, remove suggestion from both sides. Muting not affected,
since muting is supposed to be invisible to the target.
parent ef2bcf51
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -13,6 +13,11 @@ class Api::V1::SuggestionsController < Api::BaseController
render json: @accounts, each_serializer: REST::AccountSerializer
end
def destroy
PotentialFriendshipTracker.remove(current_account.id, params[:id])
render_empty
end
private
def set_accounts
......
......@@ -203,7 +203,8 @@ module AccountInteractions
private
def remove_potential_friendship(other_account)
def remove_potential_friendship(other_account, mutual = false)
PotentialFriendshipTracker.remove(id, other_account.id)
PotentialFriendshipTracker.remove(other_account.id, id) if mutual
end
end
......@@ -246,7 +246,7 @@ Rails.application.routes.draw do
resources :streaming, only: [:index]
resources :custom_emojis, only: [:index]
resources :suggestions, only: [:index]
resources :suggestions, only: [:index, :destroy]
get '/search', to: 'search#index', as: :search
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter