Skip to content
Snippets Groups Projects
Commit dc750974 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

add offset and limit to learning objects/collections index

parent 7cbbdda2
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,9 @@ class V1::CollectionsController < ApplicationController
# GET /v1/collections
# GET /v1/collections.json
def index
render json: Collection.all
limit = params[:limit] || 10
offset = params[:offset] || 0
render json: Collection.limit(limit).offset(offset)
end
# GET /v1/collections/1
......
......@@ -15,7 +15,7 @@ class V1::LearningObjectsController < ApplicationController
limit = params[:limit] || 10
offset = params[:offset] || 0
serializer = params[:obaa].nil? ? LearningObjectSerializer : LearningObjectObaaSerializer
render json: LearningObject.limit(limit).offset(offset).all, each_serializer: serializer
render json: LearningObject.limit(limit).offset(offset), each_serializer: serializer
end
# GET /learning_objects/1
......
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