Skip to content

Commit

Permalink
reformat api
Browse files Browse the repository at this point in the history
  • Loading branch information
warren830 committed Dec 23, 2024
1 parent a3b1df5 commit 52de345
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
17 changes: 4 additions & 13 deletions api/controllers/console/app/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,21 +457,12 @@ def get(self, app_model: App):
parser.add_argument("page", type=inputs.int_range(1, 99999), required=False, default=1, location="args")
parser.add_argument("limit", type=inputs.int_range(1, 100), required=False, default=20, location="args")
args = parser.parse_args()
page = args.get('page')
limit = args.get('limit')
page = args.get("page")
limit = args.get("limit")
workflow_service = WorkflowService()
workflows, has_more = workflow_service.get_all_published_workflow(
app_model=app_model,
page=page,
limit=limit
)
workflows, has_more = workflow_service.get_all_published_workflow(app_model=app_model, page=page, limit=limit)

return {
'items': workflows,
'page': page,
'limit': limit,
'has_more': has_more
}
return {"items": workflows, "page": page, "limit": limit, "has_more": has_more}


api.add_resource(DraftWorkflowApi, "/apps/<uuid:app_id>/workflows/draft")
Expand Down
4 changes: 2 additions & 2 deletions api/fields/workflow_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def format(self, value):
}

workflow_pagination_fields = {
'data': fields.List(fields.Nested(workflow_fields), attribute="data"),
'page': fields.Integer,
"data": fields.List(fields.Nested(workflow_fields), attribute="data"),
"page": fields.Integer,
"limit": fields.Integer(attribute="limit"),
"has_more": fields.Boolean(attribute="has_more"),
}

0 comments on commit 52de345

Please sign in to comment.