about summary refs log tree commit diff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-08-06 13:16:53 +0200
committerThibaut Girka <thib@sitedethib.com>2019-08-06 13:16:53 +0200
commitcad2e6eb7afe96f781175cd829b70a0667d3498a (patch)
tree7efda6a7ca7dbe62d6efa42b17c1167e751c44d3 /app/controllers/api/v1
parent3ea7a334d89d2c4075b1dbf649d692ff49325f2e (diff)
parent1d8d553d8b5cb23cc67bd530ca9eb70a6683ab2a (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r--app/controllers/api/v1/trends_controller.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/api/v1/trends_controller.rb b/app/controllers/api/v1/trends_controller.rb
new file mode 100644
index 000000000..bcea9857e
--- /dev/null
+++ b/app/controllers/api/v1/trends_controller.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class Api::V1::TrendsController < Api::BaseController
+  before_action :set_tags
+
+  respond_to :json
+
+  def index
+    render json: @tags, each_serializer: REST::TagSerializer
+  end
+
+  private
+
+  def set_tags
+    @tags = TrendingTags.get(limit_param(10))
+  end
+end