mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 03:36:44 +08:00
Update GET /tasks, GET /tasks/:id endpoints, refactor routes.rb
This commit is contained in:
parent
0643ba216e
commit
0de3c7eb4e
3 changed files with 5 additions and 16 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
module Api
|
||||
module V1
|
||||
class MyModulesController < BaseController
|
||||
class TasksController < BaseController
|
||||
before_action :load_team
|
||||
before_action :load_project
|
||||
before_action :load_experiment
|
|
@ -4,9 +4,7 @@ module Api
|
|||
module V1
|
||||
class TaskSerializer < ActiveModel::Serializer
|
||||
type :tasks
|
||||
attributes :id, :name, :due_date, :description, :state
|
||||
attribute :my_module_group_id, key: :task_group_id
|
||||
belongs_to :experiment, serializer: ExperimentSerializer
|
||||
attributes :id, :name, :due_date, :description, :state, :archived
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -563,18 +563,9 @@ Rails.application.routes.draw do
|
|||
end
|
||||
resources :projects, only: %i(index show) do
|
||||
resources :experiments, only: %i(index show) do
|
||||
resources :my_module_groups,
|
||||
only: %i(index show),
|
||||
path: 'task_groups',
|
||||
as: :task_groups
|
||||
resources :connections,
|
||||
only: %i(index show),
|
||||
path: 'connections',
|
||||
as: :connections
|
||||
resources :my_modules,
|
||||
only: %i(index show),
|
||||
path: 'tasks',
|
||||
as: :tasks do
|
||||
resources :task_groups, only: %i(index show)
|
||||
resources :connections, only: %i(index show)
|
||||
resources :tasks, only: %i(index show) do
|
||||
resources :my_module_repository_rows, only: %i(index show),
|
||||
path: 'task_inventory_rows',
|
||||
as: :task_inventory_rows
|
||||
|
|
Loading…
Reference in a new issue