diff --git a/app/controllers/api/v1/timeline_controller.rb b/app/controllers/api/v1/timeline_controller.rb index e6fab89..404dc34 100644 --- a/app/controllers/api/v1/timeline_controller.rb +++ b/app/controllers/api/v1/timeline_controller.rb @@ -15,9 +15,8 @@ class Api::V1::TimelineController < Api::V1::ApplicationController def index if @current_user stars_ids = @current_user.stars.ids - shared_posts_ids = ShareInstance.where(user_id: stars_ids).order(created_at: :desc).pluck(:sharable_id) - # liked_posts_ids = Like.where(user_id: stars_ids).order(created_at: :desc).pluck(:likable_id) - render json: Post.find(shared_posts_ids).index_by(&:id).slice(*shared_posts_ids).values, each_serializer: EachPostSerializer + posts_ids = TimelineSource.where(user_id: stars_ids).order(created_at: :desc).pluck(:post_id) + render json: Post.find(posts_ids).index_by(&:id).slice(*posts_ids).values, each_serializer: EachPostSerializer else return most_liked end