mirror of https://github.com/fspc/BikeShed-1.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
563 B
21 lines
563 B
11 years ago
|
class Api::V1::LogsController < Api::V1::BaseController
|
||
|
|
||
|
def checkin
|
||
|
if @current_user.checked_in?
|
||
|
render :json => { "error" => "You are already checked in."}, :status => 404 and return
|
||
|
else
|
||
|
@current_user.checkin
|
||
|
render :nothing => true, :status => 204 and return
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def checkout
|
||
|
if !@current_user.checked_in?
|
||
|
render :json => { "error" => "You were not even checked in."}, :status => 404 and return
|
||
|
else
|
||
|
@current_user.checkout
|
||
|
render :nothing => true, :status => 204 and return
|
||
|
end
|
||
|
end
|
||
|
end
|