Added GroupCategories API route and controller

• Added:
- GroupCategories API route and controller
This commit is contained in:
mgabdev 2020-08-05 23:12:17 -05:00
parent 7dd1e0cd0b
commit c20f7adf6a
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
class Api::V1::GroupCategoriesController < Api::BaseController
# respond_to :json
skip_before_action :set_cache_headers
def index
render_cached_json('api:v1:group_categories', expires_in: 1.minute) do
ActiveModelSerializers::SerializableResource.new(GroupCategories.all, each_serializer: REST::GroupCategoriesSerializer)
end
end
end

View File

@ -339,6 +339,7 @@ Rails.application.routes.draw do
resources :scheduled_statuses, only: [:index, :show, :update, :destroy]
resources :preferences, only: [:index]
resources :trends, only: [:index]
resources :group_categories, only: [:index]
namespace :gifs do
get :categories