2024-02-25 12:15:55 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-07-28 18:45:01 -04:00
|
|
|
class PostEventsController < ApplicationController
|
2019-11-26 17:03:43 -05:00
|
|
|
respond_to :html, :json
|
2015-07-28 18:45:01 -04:00
|
|
|
|
|
|
|
def index
|
2022-01-06 07:44:30 -05:00
|
|
|
@events = PostEventDecorator.decorate_collection(
|
|
|
|
PostEvent.includes(:creator).search(search_params).paginate(params[:page], limit: params[:limit])
|
|
|
|
)
|
2022-01-08 19:47:06 -05:00
|
|
|
respond_with(@events) do |format|
|
|
|
|
format.json do
|
|
|
|
render json: Draper.undecorate(@events)
|
|
|
|
end
|
|
|
|
end
|
2015-07-28 18:45:01 -04:00
|
|
|
end
|
|
|
|
end
|