mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-21 20:28:10 +00:00
Add task_spec_name to add_file
API call
This commit is contained in:
parent
3d7dadc319
commit
4c41011299
@ -699,6 +699,12 @@ paths:
|
||||
description: The unique id of a workflow instance
|
||||
schema:
|
||||
type: integer
|
||||
- name: task_spec_name
|
||||
in: query
|
||||
required: false
|
||||
description: The name of the task spec
|
||||
schema:
|
||||
type: string
|
||||
- name: form_field_key
|
||||
in: query
|
||||
required: false
|
||||
|
@ -41,13 +41,17 @@ def get_reference_files():
|
||||
return FileSchema(many=True).dump(files)
|
||||
|
||||
|
||||
def add_file(workflow_spec_id=None, workflow_id=None, form_field_key=None):
|
||||
def add_file(workflow_spec_id=None, workflow_id=None, task_spec_name=None, form_field_key=None):
|
||||
file = connexion.request.files['file']
|
||||
if workflow_id:
|
||||
if form_field_key is None:
|
||||
raise ApiError('invalid_workflow_file',
|
||||
'When adding a workflow related file, you must specify a form_field_key')
|
||||
if task_spec_name is None:
|
||||
raise ApiError('invalid_workflow_file',
|
||||
'When adding a workflow related file, you must specify a task_spec_name')
|
||||
file_model = FileService.add_workflow_file(workflow_id=workflow_id, irb_doc_code=form_field_key,
|
||||
task_spec_name=task_spec_name,
|
||||
name=file.filename, content_type=file.content_type,
|
||||
binary_data=file.stream.read())
|
||||
elif workflow_spec_id:
|
||||
|
Loading…
x
Reference in New Issue
Block a user