update order api action cable
This commit is contained in:
@@ -57,7 +57,7 @@ section .content{
|
||||
.nav-tabs .nav-item {
|
||||
border-bottom: 1px solid #fff;
|
||||
margin-left:2px;
|
||||
margin-right: -1.555rem;
|
||||
margin-right: -1.4755rem;
|
||||
}
|
||||
#ul-navbar{
|
||||
border-left: 1px solid #54A5AF;
|
||||
|
||||
@@ -120,6 +120,13 @@ class Api::OrdersController < Api::ApiController
|
||||
if @status && @booking
|
||||
Order.process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||
end
|
||||
if @order.table_id.to_i > 0
|
||||
table = DiningFacility.find(@booking.dining_facility_id)
|
||||
type = 'order'
|
||||
from = getCloudDomain #get sub domain in cloud mode
|
||||
ActionCable.server.broadcast "order_channel",table: table,type:type,from:from
|
||||
|
||||
end
|
||||
# # for parallel order
|
||||
# remoteIP = ""
|
||||
# begin
|
||||
@@ -263,4 +270,16 @@ class Api::OrdersController < Api::ApiController
|
||||
return return_json_status_with_code(406, "Checkout time is over!")
|
||||
end
|
||||
end
|
||||
|
||||
#get cloud domain
|
||||
def getCloudDomain
|
||||
from = ""
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
from = request.subdomain + "." + request.domain
|
||||
end
|
||||
|
||||
return from
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user