Fix json rendering error
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
class Api::ApiController < ActionController::API
|
||||
include TokenVerification, MultiTenancy
|
||||
include MultiTenancy
|
||||
include TokenVerification
|
||||
include ActionController::MimeResponds
|
||||
include ActionView::Rendering
|
||||
|
||||
# before_action :lookup_domain
|
||||
helper_method :current_token, :current_login_employee, :get_cashier
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user