mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 09:04:56 +08:00
Allow supervisor and fix start_date in Projects API, add archived_on to InventoryItemSerializer [SCI-11984]
This commit is contained in:
parent
3900fe3537
commit
008c1c127d
3 changed files with 3 additions and 7 deletions
|
@ -69,7 +69,7 @@ module Api
|
|||
|
||||
params.require(:data)
|
||||
.require(:attributes)
|
||||
.permit(:name, :visibility, :archived, :project_folder_id, :start_date, :due_date, :status, :description, metadata: {})
|
||||
.permit(:name, :visibility, :supervised_by_id, :archived, :project_folder_id, :start_date, :due_date, :status, :description, metadata: {})
|
||||
end
|
||||
|
||||
def permitted_includes
|
||||
|
|
|
@ -4,7 +4,7 @@ module Api
|
|||
module V1
|
||||
class InventoryItemSerializer < ActiveModel::Serializer
|
||||
type :inventory_items
|
||||
attributes :name, :archived
|
||||
attributes :name, :archived, :archived_on
|
||||
has_many :repository_cells, key: :inventory_cells,
|
||||
serializer: InventoryCellSerializer,
|
||||
class_name: 'RepositoryCell',
|
||||
|
|
|
@ -4,7 +4,7 @@ module Api
|
|||
module V1
|
||||
class ProjectSerializer < ActiveModel::Serializer
|
||||
type :projects
|
||||
attributes :name, :status, :visibility, :start_date, :archived, :started_at, :done_at, :start_date, :due_date, :description
|
||||
attributes :name, :status, :visibility, :archived, :started_at, :done_at, :start_date, :due_date, :description
|
||||
attribute :metadata, if: -> { scope && scope[:metadata] == true }
|
||||
|
||||
belongs_to :project_folder, serializer: ProjectFolderSerializer
|
||||
|
@ -12,10 +12,6 @@ module Api
|
|||
has_many :project_comments, key: :comments, serializer: CommentSerializer
|
||||
|
||||
include TimestampableModel
|
||||
|
||||
def start_date
|
||||
object.created_at
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue