routes: remove legacy /user/index and /artist/index API endpoints.

These endpoints get zero traffic.
This commit is contained in:
evazion
2020-12-23 19:48:35 -06:00
parent dbb66ace90
commit ca742db07a
7 changed files with 0 additions and 35 deletions

View File

@@ -17,18 +17,10 @@ class LegacyController < ApplicationController
end
end
def users
@users = User.limit(100).search(params).paginate(params[:page])
end
def tags
@tags = Tag.limit(100).search(params).paginate(params[:page], :limit => params[:limit])
end
def artists
@artists = Artist.limit(100).search(search_params).paginate(params[:page])
end
def unavailable
render :plain => "this resource is no longer available", :status => 410
end

View File

@@ -483,15 +483,6 @@ class User < ApplicationRecord
]
end
def to_legacy_json
return {
"name" => name,
"id" => id,
"level" => level,
"created_at" => created_at.strftime("%Y-%m-%d %H:%M")
}.to_json
end
def api_token
api_key.try(:key)
end

View File

@@ -1 +0,0 @@
[<%= raw @artists.map(&:to_json).join(",") %>]

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<artists type="array">
<% @artists.each do |artist| %>
<artist group_name="<%= artist.group_name %>" other_names="<%= artist.other_names %>" urls="<%= artist.urls.map {|x| x.url}.join(" ") %>" is_active="<%= !artist.is_deleted? %>" name="<%= artist.name %>" updater_id="0" id="<%= artist.id %>" version="0"/>
<% end %>
</artists>

View File

@@ -1 +0,0 @@
[<%= @users.map {|x| x.to_legacy_json}.join(", ").html_safe %>]

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<users type="array">
<% @users.each do |user| %>
<user name="<%= user.name %>" id="<%= user.id %>" created_at="<%= user.created_at.strftime('%Y-%m-%d %H:%M') %>" level="<%= user.level %>"></user>
<% end %>
</users>