Removed unused GifsController
• Removed: - unused GifsController
This commit is contained in:
parent
b0e3d611f5
commit
bfd1e1ef9d
@ -1,33 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::V1::GifsController < Api::BaseController
|
|
||||||
before_action :require_user!
|
|
||||||
|
|
||||||
respond_to :json
|
|
||||||
|
|
||||||
skip_before_action :set_cache_headers
|
|
||||||
|
|
||||||
def categories
|
|
||||||
uri = URI('https://api.tenor.com/v1/categories')
|
|
||||||
theOptions = { :key => "TENOR_KEY" }
|
|
||||||
uri.query = URI.encode_www_form(theOptions)
|
|
||||||
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
render json: res.body if res.is_a?(Net::HTTPSuccess)
|
|
||||||
end
|
|
||||||
|
|
||||||
def search
|
|
||||||
uri = URI('https://api.tenor.com/v1/search')
|
|
||||||
theOptions = {
|
|
||||||
:key => "TENOR_KEY",
|
|
||||||
:media_filter => "minimal",
|
|
||||||
:limit => 30,
|
|
||||||
:q => params[:search],
|
|
||||||
:pos => params[:next] || 0
|
|
||||||
}
|
|
||||||
uri.query = URI.encode_www_form(theOptions)
|
|
||||||
|
|
||||||
res = Net::HTTP.get_response(uri)
|
|
||||||
render json: res.body if res.is_a?(Net::HTTPSuccess)
|
|
||||||
end
|
|
||||||
end
|
|
@ -347,11 +347,6 @@ Rails.application.routes.draw do
|
|||||||
resources :trends, only: [:index]
|
resources :trends, only: [:index]
|
||||||
resources :group_categories, only: [:index]
|
resources :group_categories, only: [:index]
|
||||||
|
|
||||||
namespace :gifs do
|
|
||||||
get :categories
|
|
||||||
get :search
|
|
||||||
end
|
|
||||||
|
|
||||||
resources :conversations, only: [:index, :destroy] do
|
resources :conversations, only: [:index, :destroy] do
|
||||||
member do
|
member do
|
||||||
post :read
|
post :read
|
||||||
|
Loading…
Reference in New Issue
Block a user