Update GET /tasks, GET /tasks/:id endpoints, refactor routes.rb

This commit is contained in:
Luka Murn 2018-10-07 09:45:24 +02:00
parent 0643ba216e
commit 0de3c7eb4e
3 changed files with 5 additions and 16 deletions

View file

@ -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

View file

@ -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

View file

@ -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