2013-02-05 13:16:51 -06:00
|
|
|
class UserActionsController < ApplicationController
|
|
|
|
def index
|
|
|
|
requires_parameters(:user_id)
|
|
|
|
per_chunk = 60
|
2013-03-22 13:08:11 -05:00
|
|
|
render json: UserAction.stream(
|
2013-02-07 09:45:24 -06:00
|
|
|
user_id: params[:user_id].to_i,
|
|
|
|
offset: params[:offset],
|
|
|
|
limit: per_chunk,
|
2013-02-05 13:16:51 -06:00
|
|
|
action_types: (params[:filter] || "").split(","),
|
|
|
|
guardian: guardian,
|
|
|
|
ignore_private_messages: params[:filter] ? false : true
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
requires_parameters(:id)
|
2013-03-22 13:08:11 -05:00
|
|
|
render json: UserAction.stream_item(params[:id], guardian)
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
def private_messages
|
|
|
|
# todo
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|