API login/logout with http header token
This commit is contained in:
@@ -1,28 +1,35 @@
|
||||
class Api::Restaurant::MenuController < Api::ApiController
|
||||
before :authenticate_token
|
||||
|
||||
#Description
|
||||
# Pull the default menu details and also other available (active) menus
|
||||
# Input Params - order_id
|
||||
def index
|
||||
menu_detail()
|
||||
@menu = menu_detail()
|
||||
end
|
||||
|
||||
#Description
|
||||
# This API show current order details
|
||||
# Input Params - menu_id
|
||||
def show
|
||||
menu_detail(params[:menu_id])
|
||||
@menu = menu_detail(params[:id])
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def menu_detail
|
||||
def menu_detail (menu_id)
|
||||
if (menu_id)
|
||||
#Pull this menu
|
||||
menu = Menu.find_by_id(menu_id)
|
||||
return menu
|
||||
else
|
||||
#Pull Default menu
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def menu_params()
|
||||
params.permit(:id)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user