Added routes for trending_hashtags, expenses

• Added:
- routes for trending_hashtags, expenses
This commit is contained in:
mgabdev
2021-01-15 14:28:52 -05:00
parent 0269c7e107
commit c33013cccf
3 changed files with 24 additions and 0 deletions

View File

@@ -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

View File

@@ -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