add pagination to API
This commit is contained in:
parent
6817a6a295
commit
76e4d94d43
6 changed files with 16 additions and 5 deletions
|
@ -14,6 +14,10 @@ module Gitlab
|
|||
@project
|
||||
end
|
||||
|
||||
def paginate(object)
|
||||
object.page(params[:page]).per(params[:per_page].to_i)
|
||||
end
|
||||
|
||||
def authenticate!
|
||||
error!({'message' => '401 Unauthorized'}, 401) unless current_user
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue