mirror of https://github.com/langgenius/dify.git
fix app convert
This commit is contained in:
parent
7762737796
commit
74408c4ced
|
|
@ -270,14 +270,15 @@ class ConvertToWorkflowApi(Resource):
|
|||
"""
|
||||
# convert to workflow mode
|
||||
workflow_service = WorkflowService()
|
||||
workflow = workflow_service.convert_to_workflow(
|
||||
new_app_model = workflow_service.convert_to_workflow(
|
||||
app_model=app_model,
|
||||
account=current_user
|
||||
)
|
||||
|
||||
# return workflow
|
||||
return workflow
|
||||
|
||||
# return app id
|
||||
return {
|
||||
'new_app_id': new_app_model.id,
|
||||
}
|
||||
|
||||
|
||||
api.add_resource(DraftWorkflowApi, '/apps/<uuid:app_id>/workflows/draft')
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ class WorkflowConverter:
|
|||
new_app.is_demo = False
|
||||
new_app.is_public = app_model.is_public
|
||||
db.session.add(new_app)
|
||||
db.session.flush()
|
||||
db.session.commit()
|
||||
|
||||
workflow.app_id = new_app.id
|
||||
db.session.commit()
|
||||
|
||||
app_was_created.send(new_app, account=account)
|
||||
|
|
|
|||
Loading…
Reference in New Issue