mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
16 lines
339 B
Ruby
16 lines
339 B
Ruby
|
class OpenAPI::V1::EventsController < OpenAPI::V1::BaseController
|
||
|
def index
|
||
|
@events = Event.order(created_at: :desc)
|
||
|
|
||
|
if params[:page].present?
|
||
|
@events = @events.page(params[:page]).per(per_page)
|
||
|
paginate @events, per_page: per_page
|
||
|
end
|
||
|
end
|
||
|
|
||
|
private
|
||
|
def per_page
|
||
|
params[:per_page] || 20
|
||
|
end
|
||
|
end
|