Class: Logistics::Core::AdditionalDocumentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/logistics/core/additional_documents_controller.rb

Instance Method Summary collapse

Instance Method Details

#bulk_deleteObject



31
32
33
34
35
# File 'app/controllers/logistics/core/additional_documents_controller.rb', line 31

def bulk_delete
  success, error = @service.bulk_delete(params[:ids])
  response = Mks::Common::MethodResponse.new(success, nil, nil, [error], nil)
  render json: response
end

#bulk_saveObject



19
20
21
22
23
# File 'app/controllers/logistics/core/additional_documents_controller.rb', line 19

def bulk_save
  success, error = @service.bulk_save(additional_document_params[:payload])
  response = Mks::Common::MethodResponse.new(success, nil, nil, [error], nil)
  render json: response
end

#bulk_updateObject



25
26
27
28
29
# File 'app/controllers/logistics/core/additional_documents_controller.rb', line 25

def bulk_update
  success, error = @service.bulk_update(additional_document_params[:payload])
  response = Mks::Common::MethodResponse.new(success, nil, nil, [error], nil)
  render json: response
end

#get_document_typesObject



12
13
14
15
16
17
# File 'app/controllers/logistics/core/additional_documents_controller.rb', line 12

def get_document_types
  documents = @service.get_additional_documents(params[:entity], params[:rec_id])
  data = ActiveModelSerializers::SerializableResource.new(documents).as_json
  response = Mks::Common::MethodResponse.new(true, nil, data, nil, nil)
  render json: response
end

#get_lookup_valuesObject



6
7
8
9
10
# File 'app/controllers/logistics/core/additional_documents_controller.rb', line 6

def get_lookup_values
  values = @service.get_lookup_values(params[:entity])
  response = Mks::Common::MethodResponse.new(true, nil, values, nil, nil)
  render json: response
end