shop code
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
class Api::ApiController < ActionController::API
|
||||
|
||||
|
||||
include MultiTenancy
|
||||
include TokenVerification
|
||||
include ActionView::Rendering
|
||||
include ActionController::MimeResponds
|
||||
include ActionView::Rendering
|
||||
|
||||
before_action :core_allow
|
||||
helper_method :current_token, :current_login_employee, :get_cashier
|
||||
@@ -15,6 +18,12 @@ class Api::ApiController < ActionController::API
|
||||
|
||||
private
|
||||
|
||||
# ActionView::Rendering override render_to_body breaks render :json,
|
||||
# resulting in an ActionView::MissingTemplate error.
|
||||
def render_to_body(options)
|
||||
_render_to_body_with_renderer(options) || super
|
||||
end
|
||||
|
||||
#this is base api base controller to need to inherit.
|
||||
#all token authentication must be done here
|
||||
#response format must be set to JSON
|
||||
|
||||
@@ -62,8 +62,8 @@ class Api::OrdersController < Api::ApiController
|
||||
def create
|
||||
Rails.logger.debug "Order Source - " + params[:order_source].to_s
|
||||
Rails.logger.debug "Table ID - " + params[:table_id].to_s
|
||||
@shop = Shop.find_by_shop_code(params[:shop_code])
|
||||
current_shift = ShiftSale.current_shift(@shop.shop_code)
|
||||
# @shop = Shop.find_by_shop_code(params[:shop_code])
|
||||
current_shift = ShiftSale.current_shift
|
||||
if current_shift.nil?
|
||||
@status = false
|
||||
@message = "No Current Open Shift for This Employee"
|
||||
|
||||
Reference in New Issue
Block a user