mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 22:55:34 +08:00
Fixed attribute names
This commit is contained in:
parent
5f39404e83
commit
e47acfb4a1
6 changed files with 21 additions and 14 deletions
|
@ -4,8 +4,9 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
class MyModuleRepositoryRowSerializer < ActiveModel::Serializer
|
class MyModuleRepositoryRowSerializer < ActiveModel::Serializer
|
||||||
type :task_inventory_rows
|
type :task_inventory_rows
|
||||||
attributes :id, :repository_row_id, :my_module_id
|
attribute :id
|
||||||
|
attribute :repository_row_id, key: :inventory_row_id
|
||||||
|
attribute :my_module_id, key: :task_id
|
||||||
belongs_to :my_module, serializer: MyModuleSerializer
|
belongs_to :my_module, serializer: MyModuleSerializer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,9 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
class MyModuleTagSerializer < ActiveModel::Serializer
|
class MyModuleTagSerializer < ActiveModel::Serializer
|
||||||
type :task_tags
|
type :task_tags
|
||||||
attributes :id, :my_module_id, :tag_id
|
attributes :id, :tag_id
|
||||||
|
attribute :my_module_id, key: :task_id
|
||||||
|
|
||||||
belongs_to :my_module, serializer: MyModuleSerializer
|
belongs_to :my_module, serializer: MyModuleSerializer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,8 +5,10 @@ module Api
|
||||||
class ProtocolSerializer < ActiveModel::Serializer
|
class ProtocolSerializer < ActiveModel::Serializer
|
||||||
type :protocols
|
type :protocols
|
||||||
attributes :id, :name, :authors, :description,
|
attributes :id, :name, :authors, :description,
|
||||||
:my_module_id, :team_id, :protocol_type,
|
:team_id, :protocol_type,
|
||||||
:nr_of_linked_children
|
:nr_of_linked_children
|
||||||
|
attribute :my_module_id, key: :task_id
|
||||||
|
|
||||||
belongs_to :my_module, serializer: MyModuleSerializer
|
belongs_to :my_module, serializer: MyModuleSerializer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,8 +4,9 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
class ResultSerializer < ActiveModel::Serializer
|
class ResultSerializer < ActiveModel::Serializer
|
||||||
type :results
|
type :results
|
||||||
attributes :id, :name, :my_module_id, :user_id, :archived, :result_text,
|
attributes :id, :name, :user_id, :archived, :result_text,
|
||||||
:result_table, :result_asset
|
:result_table, :result_asset
|
||||||
|
attribute :my_module_id, key: :task_id
|
||||||
|
|
||||||
belongs_to :my_module, serializer: MyModuleSerializer
|
belongs_to :my_module, serializer: MyModuleSerializer
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,8 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
class UserMyModuleSerializer < ActiveModel::Serializer
|
class UserMyModuleSerializer < ActiveModel::Serializer
|
||||||
type :user_tasks
|
type :user_tasks
|
||||||
attributes :id, :user_id, :my_module_id
|
attributes :id, :user_id
|
||||||
|
attribute :my_module_id, key: :task_id
|
||||||
|
|
||||||
belongs_to :my_module, serializer: MyModuleSerializer
|
belongs_to :my_module, serializer: MyModuleSerializer
|
||||||
end
|
end
|
||||||
|
|
|
@ -556,6 +556,14 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
resources :projects, only: %i(index show) do
|
resources :projects, only: %i(index show) do
|
||||||
resources :experiments, 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,
|
resources :my_modules,
|
||||||
only: %i(index show),
|
only: %i(index show),
|
||||||
path: 'tasks',
|
path: 'tasks',
|
||||||
|
@ -587,14 +595,6 @@ Rails.application.routes.draw do
|
||||||
path: 'activities',
|
path: 'activities',
|
||||||
as: :activities
|
as: :activities
|
||||||
end
|
end
|
||||||
resources :my_module_groups,
|
|
||||||
only: %i(index show),
|
|
||||||
path: 'task_groups',
|
|
||||||
as: :task_groups
|
|
||||||
resources :connections,
|
|
||||||
only: %i(index show),
|
|
||||||
path: 'connections',
|
|
||||||
as: :connections
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue