better broadcasting for user
This commit is contained in:
@@ -213,9 +213,7 @@ class UserController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: {list_active: false} and return unless list.present?
|
||||
list.needs_help = true
|
||||
list.save
|
||||
broadcast_supplier(list.supplier_id, 'list_needs_help', id: list.id)
|
||||
list.needs_help!
|
||||
render json: list.as_json.merge(list_active: list.active?)
|
||||
end
|
||||
end
|
||||
@@ -299,7 +297,7 @@ class UserController < ApplicationController
|
||||
if @table.occupied?
|
||||
render json: {occupied: true}
|
||||
else
|
||||
list.move_to_table @table
|
||||
list.move_to_table! @table
|
||||
render json: {occupied: false}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user