Skip to content

Commit

Permalink
template fix bug (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojin3616 committed Jan 15, 2024
2 parents 3a6cf77 + 8f900e3 commit 73c5374
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/bisheng/api/v1/skillcenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def read_template(*,
"""Read all flows."""
sql = select(Template.id, Template.name, Template.description, Template.update_time)
if id:
sql = select(Template).where(Template.id == id)
template = session.get(Template, id)
return resp_200([template])
if name:
sql.where(Template.name == name)
sql.order_by(Template.order_num.desc())
if page_size and page_name:
sql.offset(page_size * (page_name - 1)).limit(page_size)

try:
template_session = session.exec(sql)
templates = template_session.mappings().all()
Expand Down

0 comments on commit 73c5374

Please sign in to comment.