Skip to content

Commit

Permalink
Groupby error in API
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Sep 29, 2024
1 parent d59a2cb commit 332347f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ async def get_repositories(uri: str | None = None, branch: str | None = None, ma
FROM runs as r
LEFT JOIN machines as m on r.machine_id = m.id
WHERE 1=1
GROUP BY r.uri
"""
params = []

Expand All @@ -244,6 +243,8 @@ async def get_repositories(uri: str | None = None, branch: str | None = None, ma
query = f"{query} AND m.description LIKE %s \n"
params.append(f"%{machine}%")

query = f"{query} GROUP BY r.uri\n"

if sort_by == 'name':
query = f"{query} ORDER BY r.uri ASC"
else:
Expand Down

0 comments on commit 332347f

Please sign in to comment.