autocomplete: remove old autocomplete endpoints.

Remove /tag/autocomplete.json and /saved_searches/labels.json.
This commit is contained in:
evazion
2020-12-20 00:39:05 -06:00
parent 9de7a07af7
commit 28926c2332
9 changed files with 2 additions and 303 deletions

View File

@@ -6,12 +6,6 @@ class SavedSearchesController < ApplicationController
respond_with(@saved_searches)
end
def labels
authorize SavedSearch
@labels = SavedSearch.search_labels(CurrentUser.id, params[:search]).take(params[:limit].to_i || 10)
respond_with(@labels)
end
def create
@saved_search = authorize SavedSearch.new(user: CurrentUser.user, **permitted_attributes(SavedSearch))
@saved_search.save

View File

@@ -12,18 +12,6 @@ class TagsController < ApplicationController
respond_with(@tags)
end
def autocomplete
if CurrentUser.is_builder?
# limit rollout
@tags = TagAutocomplete.search(params[:search][:name_matches])
else
@tags = Tag.names_matches_with_aliases(params[:search][:name_matches], params.fetch(:limit, 10).to_i)
end
# XXX
respond_with(@tags.map(&:attributes))
end
def show
@tag = authorize Tag.find(params[:id])
respond_with(@tag)