update add order
This commit is contained in:
39
app/controllers/api/restaurant/menu_categories_controller.rb
Normal file
39
app/controllers/api/restaurant/menu_categories_controller.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
class Api::Restaurant::MenuCategoriesController < Api::ApiController
|
||||
skip_before_action :authenticate
|
||||
#Description
|
||||
# Pull the default menu details and also other available (active) menus
|
||||
# Input Params - order_id
|
||||
def index
|
||||
@menus = MenuCategory.all
|
||||
@current_menu = MenuCategory.current_menu
|
||||
|
||||
end
|
||||
|
||||
#Description
|
||||
# This API show current order details
|
||||
# Input Params - menu_id
|
||||
def show
|
||||
puts "SSSSSSSSSSSSS"
|
||||
@menu = menu_detail(params[:id])
|
||||
puts @menu.to_json
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def menu_detail (menu_id)
|
||||
if (menu_id)
|
||||
#Pull this menu
|
||||
menu = MenuCategory.find_by_id(menu_id)
|
||||
return menu
|
||||
else
|
||||
MenuCategory.current_menu
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def menu_params()
|
||||
params.permit(:id)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user