2022-11-08 10:45:39 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-01-24 16:48:05 +01:00
|
|
|
json.extract! training, :id, :name, :description, :machine_ids, :nb_total_places, :public_page, :disabled, :slug,
|
2023-01-27 17:31:16 +01:00
|
|
|
:auto_cancel, :auto_cancel_threshold, :auto_cancel_deadline, :authorization, :authorization_period, :invalidation,
|
|
|
|
:invalidation_period
|
2022-11-08 10:45:39 +01:00
|
|
|
if training.training_image
|
|
|
|
json.training_image_attributes do
|
|
|
|
json.id training.training_image.id
|
|
|
|
json.attachment_name training.training_image.attachment_identifier
|
2023-11-10 15:59:21 +01:00
|
|
|
json.attachment_url training.training_image.attachment.large.url
|
2022-11-08 10:45:39 +01:00
|
|
|
end
|
|
|
|
end
|
2022-11-10 16:14:49 +01:00
|
|
|
|
|
|
|
if training.advanced_accounting
|
|
|
|
json.advanced_accounting_attributes do
|
|
|
|
json.partial! 'api/advanced_accounting/advanced_accounting', advanced_accounting: training.advanced_accounting
|
|
|
|
end
|
|
|
|
end
|