2023-12-14 18:31:12 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# rubocop:disable Metrics/BlockLength
|
|
|
|
|
|
|
|
namespace :v2 do
|
2024-01-15 17:01:51 +08:00
|
|
|
resources :teams, only: [] do
|
|
|
|
resources :projects, only: [] do
|
|
|
|
resources :experiments, only: [] do
|
|
|
|
resources :tasks, only: [] do
|
2023-12-14 18:31:12 +08:00
|
|
|
resources :results, only: %i(index create show update destroy) do
|
2024-01-08 17:31:14 +08:00
|
|
|
scope module: 'result_elements' do
|
|
|
|
resources :assets, except: %i(new edit), path: 'attachments'
|
|
|
|
resources :tables, except: %i(new edit), path: 'tables'
|
|
|
|
resources :texts, except: %i(new edit)
|
|
|
|
end
|
2023-12-14 18:31:12 +08:00
|
|
|
end
|
2023-12-19 22:36:41 +08:00
|
|
|
|
2024-01-15 17:01:51 +08:00
|
|
|
resources :protocols, only: [] do
|
2023-12-19 22:36:41 +08:00
|
|
|
resources :steps, except: %i(new edit) do
|
|
|
|
scope module: 'step_elements' do
|
2024-01-08 17:31:14 +08:00
|
|
|
resources :assets, except: %i(new edit), path: 'attachments'
|
2023-12-19 22:36:41 +08:00
|
|
|
resources :checklists, except: %i(new edit) do
|
|
|
|
resources :checklist_items, except: %i(new edit), as: :items
|
|
|
|
end
|
|
|
|
resources :tables, except: %i(new edit)
|
|
|
|
resources :texts, except: %i(new edit)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2023-12-14 18:31:12 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2024-01-15 17:01:51 +08:00
|
|
|
|
|
|
|
resources :inventories, only: [] do
|
|
|
|
resources :inventory_items,
|
|
|
|
path: 'items',
|
|
|
|
only: [],
|
|
|
|
as: :items do
|
2024-01-24 17:04:38 +08:00
|
|
|
resources :child_relationships,
|
|
|
|
only: %i(index show create destroy),
|
|
|
|
controller: :inventory_item_child_relationships
|
|
|
|
resources :parent_relationships,
|
|
|
|
only: %i(index show create destroy),
|
|
|
|
controller: :inventory_item_parent_relationships
|
2024-01-15 17:01:51 +08:00
|
|
|
end
|
|
|
|
end
|
2023-12-14 18:31:12 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# rubocop:enable Metrics/BlockLength
|