Class: Api::AlgoliumController

Inherits:
ApplicationController show all
Defined in:
app/controllers/api/algolium_controller.rb

Instance Method Summary collapse

Methods included from Response

#json_response

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
# File 'app/controllers/api/algolium_controller.rb', line 7

def create
  if current_user.has_role? :jogl_admin
    UpdateObjectsAlgolia.perform_async
    render json: { data: 'The objects are updating' }, status: :ok
  else
    render json: { data: 'Forbidden' }, status: :forbidden
  end
end