Class: Api::Dashboard::AccountsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/dashboard/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#current_user, #identity_cache_memoization, #restaurants, #set_options

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from ControllerHelpers

#check_boolean_param, #get_banners, #inventory_params, #reservation_params

Methods included from ResponseCacheConcern

#my_response_cache

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/api/dashboard/accounts_controller.rb', line 5

def create
  service = RestaurantService::CreateBasic.new(other_params, staff_param, restaurant_param, inventory_templates_param)
  result = service.execute
  if result.success?
    json = StaffSerializer.new(result.data, include: [:restaurants]).as_json
    render json: json
  else
    render_error(result, :unprocessable_entity)
  end
end