Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2018-05-04 11:19:11 +06:30
3 changed files with 9 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ class BaseOrigamiController < ActionController::Base
before_action :check_user
#before_action :check_installation
protect_from_forgery with: :exception
helper_method :shop_detail, :current_token
@@ -14,18 +15,14 @@ class BaseOrigamiController < ActionController::Base
redirect_to origami_dashboard_path
end
def check_user
def check_user
if check_mobile
if current_user.nil?
return render status: 401, json: {
message: "User using other device!"
}.to_json
end
else
if ENV["SERVER_MODE"] != 'cloud'
protect_from_forgery with: :exception
end
else
if current_user.nil?
redirect_to root_path
end

View File

@@ -15,12 +15,11 @@ class Origami::OtherChargesController < BaseOrigamiController
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
else
@table = nil
end
end
end
end
def create
def create
sale_id = params[:sale_id]
other_charges_items = JSON.parse(params[:other_charges_items])
sub_total = params[:sub_total]
@@ -79,8 +78,6 @@ class Origami::OtherChargesController < BaseOrigamiController
if !table.nil?
dining = {:table_id => table_id, :table_type => table.type }
render :json => dining.to_json
end
end
end
end
end