From b356c915effff8ae3ea11bc4e3798564b92cdbf0 Mon Sep 17 00:00:00 2001 From: glacials Date: Sat, 26 Dec 2020 08:58:55 -0800 Subject: [PATCH] Paginate feed_items API --- app/controllers/api/v4/feed_items_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v4/feed_items_controller.rb b/app/controllers/api/v4/feed_items_controller.rb index b6c1e35a..e7390957 100644 --- a/app/controllers/api/v4/feed_items_controller.rb +++ b/app/controllers/api/v4/feed_items_controller.rb @@ -10,10 +10,10 @@ class Api::V4::FeedItemsController < Api::V4::ApplicationController private def set_feed_items - @feed_items = Run.includes(:game, :category, :user).where( + @feed_items = paginate(Run.includes(:game, :category, :user).where( users: { twitch: current_user.twitch.follows }, ).where.not( games: { name: [nil, ""] }, - ).order("runs.created_at DESC").limit(6).map { |run| { type: :run, run: run } } + ).order("runs.created_at DESC").map { |run| { type: :run, run: run } }) end end -- knotmirror 0.0.1