autocomplete: remove old autocomplete endpoints.
Remove /tag/autocomplete.json and /saved_searches/labels.json.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user