mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 21:28:32 +00:00
Add include_archived parameter to get_document_directory api endpoint
This commit is contained in:
parent
39e005dc24
commit
bc4109a9d0
@ -83,6 +83,11 @@ paths:
|
|||||||
required : false
|
required : false
|
||||||
schema :
|
schema :
|
||||||
type : integer
|
type : integer
|
||||||
|
- name : include_archived
|
||||||
|
in : query
|
||||||
|
required : false
|
||||||
|
schema :
|
||||||
|
type : boolean
|
||||||
get:
|
get:
|
||||||
operationId: crc.api.document.get_document_directory
|
operationId: crc.api.document.get_document_directory
|
||||||
summary: Returns a directory of all files for study in a nested structure
|
summary: Returns a directory of all files for study in a nested structure
|
||||||
|
@ -5,12 +5,12 @@ from crc.services.lookup_service import LookupService
|
|||||||
from crc.services.user_file_service import UserFileService
|
from crc.services.user_file_service import UserFileService
|
||||||
|
|
||||||
|
|
||||||
def get_document_directory(study_id, workflow_id=None):
|
def get_document_directory(study_id, workflow_id=None, include_archived=False):
|
||||||
"""
|
"""
|
||||||
return a nested list of files arranged according to the category hierarchy
|
return a nested list of files arranged according to the category hierarchy
|
||||||
defined in the doc dictionary
|
defined in the doc dictionary
|
||||||
"""
|
"""
|
||||||
file_models = UserFileService.get_files_for_study(study_id=study_id)
|
file_models = UserFileService.get_files_for_study(study_id=study_id, irb_doc_code=None, include_archived=include_archived)
|
||||||
doc_dict = DocumentService.get_dictionary()
|
doc_dict = DocumentService.get_dictionary()
|
||||||
files = (File.from_file_model(model, doc_dict) for model in file_models)
|
files = (File.from_file_model(model, doc_dict) for model in file_models)
|
||||||
directory = DocumentService.get_directory(doc_dict, files, workflow_id)
|
directory = DocumentService.get_directory(doc_dict, files, workflow_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user