Added routes for trending_hashtags, expenses
• Added: - routes for trending_hashtags, expenses
This commit is contained in:
parent
0269c7e107
commit
c33013cccf
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::ExpensesController < EmptyController
|
||||
|
||||
def show
|
||||
amount = Redis.current.get("monthly_funding_amount") || 0
|
||||
amount = [amount.to_f, 100].min
|
||||
render json: { "expenses": amount }
|
||||
end
|
||||
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::TrendingHashtagsController < EmptyController
|
||||
|
||||
def show
|
||||
tags = Redis.current.get("admin_trending_hashtags") || ""
|
||||
tags = tags.strip.split(", ")
|
||||
render json: { trending_hashtags: tags }
|
||||
end
|
||||
|
||||
end
|
|
@ -285,6 +285,8 @@ Rails.application.routes.draw do
|
|||
resources :shortcuts, only: [:index, :create, :show, :destroy]
|
||||
resources :albums, only: [:create, :update, :show, :destroy]
|
||||
resources :album_lists, only: [:show]
|
||||
resource :trending_hashtags, only: [:show]
|
||||
resource :expenses, only: [:show]
|
||||
|
||||
resources :bookmark_collections, only: [:index, :create, :show, :update, :destroy] do
|
||||
resources :bookmarks, only: [:index], controller: 'bookmark_collections/bookmarks'
|
||||
|
|
Loading…
Reference in New Issue