Class: Api::V2::Bioscan::ExportPoolXpToTractionController

Inherits:
ApplicationController show all
Defined in:
app/controllers/api/v2/bioscan/export_pool_xp_to_traction_controller.rb

Overview

Endpoint to export a PoolXP tube to Traction

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Methods included from FlashTruncation

#max_flash_size, #truncate_flash, #truncate_flash_array

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
# File 'app/controllers/api/v2/bioscan/export_pool_xp_to_traction_controller.rb', line 11

def create
  Rails.logger.debug { "Creating export_pool_xp_to_traction job for tube with barcode '#{barcode}'" }

  errors = preflight_errors(barcode)
  render json: { errors: }, status: :unprocessable_entity and return unless errors.empty?

  Delayed::Job.enqueue ExportPoolXpToTractionJob.new(barcode)
  render json: {}, status: :ok
end