Merge branch 'r-1902001-01' into foodcourt
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class Api::CallWaitersController < ActionController::API
|
||||
|
||||
class Api::CallWaitersController < Api::ApiController
|
||||
#List all active customers by name
|
||||
def index
|
||||
@table_id = params[:dining_id]
|
||||
@@ -23,10 +22,11 @@ class Api::CallWaitersController < ActionController::API
|
||||
end
|
||||
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from, shift_ids: shift_ids
|
||||
# get printer info
|
||||
@shop = Shop.current_shop
|
||||
unique_code = "CallWaiterPdf"
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_call_waiter(print_settings,@table,@time,current_shop)
|
||||
printer.print_call_waiter(print_settings,@table,@time,@shop)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Api::CustomersController < Api::ApiController
|
||||
|
||||
|
||||
#List all active customers by name
|
||||
def index
|
||||
@customers = Customer.order("name asc")
|
||||
@@ -10,6 +10,26 @@ class Api::CustomersController < Api::ApiController
|
||||
@customer = Customer.find_by(params[:id])
|
||||
end
|
||||
|
||||
def create
|
||||
return unless params[:name].present? && params[:email].present? && params[:contact_no].present?
|
||||
@customer = Customer.new(name: params[:name], email: params[:email], contact_no: params[:contact_no])
|
||||
if @customer.save
|
||||
status = true
|
||||
else
|
||||
status = false
|
||||
end
|
||||
render json: status
|
||||
end
|
||||
|
||||
def get_customer_by_phone
|
||||
if @customer = Customer.find_by_contact_no(params[:contact_no])
|
||||
status = true
|
||||
else
|
||||
status = false
|
||||
end
|
||||
render json: status
|
||||
end
|
||||
|
||||
#Show customer detail by Order item
|
||||
def get_customer_order
|
||||
@customer = Customer.find(params[:id])
|
||||
|
||||
Reference in New Issue
Block a user