Added routes for trending_hashtags, expenses
• Added: - routes for trending_hashtags, expenses
This commit is contained in:
11
app/controllers/api/v1/expenses_controller.rb
Normal file
11
app/controllers/api/v1/expenses_controller.rb
Normal 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
|
||||
11
app/controllers/api/v1/trending_hashtags_controller.rb
Normal file
11
app/controllers/api/v1/trending_hashtags_controller.rb
Normal 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
|
||||
Reference in New Issue
Block a user