Skip to content
Snippets Groups Projects
Commit 28282f4f authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

paginate user likes

parent 714c191f
No related branches found
No related tags found
No related merge requests found
......@@ -50,15 +50,17 @@ module PublisherController
def show_liked_learning_objects
includes = [:taggings, :tags, :subject_relations, :subjects, :stage_relations, :educational_stages, :publisher, :language, :license]
render json: LearningObject.includes(includes).find(
learning_objects = paginate LearningObject.includes(includes).find(
Like.where(user: @publisher, likeable_type: 'LearningObject').pluck(:likeable_id)
)
render json: learning_objects
end
def show_liked_collections
render json: Collection.find(
collections = paginate Collection.find(
Like.where(user: @publisher, likeable_type: 'Collection').pluck(:likeable_id)
)
render json: collections
end
protected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment