Skip to content

Commit

Permalink
add created_at return in publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost committed Mar 15, 2024
1 parent c2edf62 commit 50482b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/controllers/console/app/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ def post(self, app_model: App):
Publish workflow
"""
workflow_service = WorkflowService()
workflow_service.publish_workflow(app_model=app_model, account=current_user)
workflow = workflow_service.publish_workflow(app_model=app_model, account=current_user)

return {
"result": "success"
"result": "success",
"created_at": TimestampField().format(workflow.created_at)
}


Expand Down
1 change: 1 addition & 0 deletions api/services/workflow_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def publish_workflow(self, app_model: App,

# commit db session changes
db.session.add(workflow)
db.session.flush()
db.session.commit()

app_model.workflow_id = workflow.id
Expand Down

0 comments on commit 50482b0

Please sign in to comment.