checkin
This commit is contained in:
@@ -6,9 +6,8 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
|
|||||||
disconnected: function() {},
|
disconnected: function() {},
|
||||||
|
|
||||||
received: function(data) {
|
received: function(data) {
|
||||||
if((data.table != undefined) && (data.table.length > 0)){
|
|
||||||
$.each(data.table,function(key,value){
|
$.each(data.table,function(key,value){
|
||||||
console.log(value.table_id);
|
// console.log(value.table_id);
|
||||||
if($('.table_'+value.table_id).hasClass('blue')){
|
if($('.table_'+value.table_id).hasClass('blue')){
|
||||||
$('.table_'+value.table_id).removeClass('blue');
|
$('.table_'+value.table_id).removeClass('blue');
|
||||||
$('.table_'+value.table_id).addClass('orange');
|
$('.table_'+value.table_id).addClass('orange');
|
||||||
@@ -23,8 +22,6 @@ App.order = App.cable.subscriptions.create('CheckinChannel', {
|
|||||||
}
|
}
|
||||||
$('.new_text_'+value.table_id).removeClass('hide');
|
$('.new_text_'+value.table_id).removeClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ class CheckinJob < ApplicationJob
|
|||||||
|
|
||||||
def perform()
|
def perform()
|
||||||
table = DiningFacility.get_checkin_booking
|
table = DiningFacility.get_checkin_booking
|
||||||
|
if table.length > 0
|
||||||
ActionCable.server.broadcast "checkin_channel",table: table
|
ActionCable.server.broadcast "checkin_channel",table: table
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user