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

add X-Total-Count in header

parent 4c1d38ad
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ class V1::LearningObjectsController < ApplicationController
limit = params[:limit] || 10
offset = params[:offset] || 0
serializer = params[:obaa].nil? ? LearningObjectSerializer : LearningObjectObaaSerializer
response.headers['X-Total-Count'] = [LearningObject.count]
render json: LearningObject.includes(:tags, :publisher, :language, :license).limit(limit).offset(offset), each_serializer: serializer
end
......
......@@ -55,7 +55,7 @@ module Portalmec
origins '*'
resource '*',
:headers => :any,
:expose => ['access-token', 'expiry', 'token-type', 'uid', 'client'],
:expose => ['access-token', 'expiry', 'token-type', 'uid', 'client', 'x-total-count'],
:methods => [:get, :post, :options, :delete, :put]
end
end
......
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