Velocipede's User, Sales, and Bike Inventory Web App
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.
|
|
|
class Api::V1::LogsController < Api::V1::BaseController
|
|
|
|
|
|
|
|
def checkin
|
|
|
|
#must use @current_user since user may not have signed in
|
|
|
|
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
|
|
|
|
#must use @current_user since user may not have signed in
|
|
|
|
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
|