From bfd1e1ef9d70a27f31d8e829feae46fa26fcb2b6 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 9 Nov 2020 12:15:57 -0600 Subject: [PATCH] Removed unused GifsController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - unused GifsController --- app/controllers/api/v1/gifs_controller.rb | 33 ----------------------- config/routes.rb | 5 ---- 2 files changed, 38 deletions(-) delete mode 100644 app/controllers/api/v1/gifs_controller.rb diff --git a/app/controllers/api/v1/gifs_controller.rb b/app/controllers/api/v1/gifs_controller.rb deleted file mode 100644 index e4c797a0..00000000 --- a/app/controllers/api/v1/gifs_controller.rb +++ /dev/null @@ -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 diff --git a/config/routes.rb b/config/routes.rb index c9a34830..4bc06283 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -347,11 +347,6 @@ Rails.application.routes.draw do resources :trends, only: [:index] resources :group_categories, only: [:index] - namespace :gifs do - get :categories - get :search - end - resources :conversations, only: [:index, :destroy] do member do post :read