Skip to content

Commit

Permalink
Have infractions sorted by id
Browse files Browse the repository at this point in the history
  • Loading branch information
LightSage committed Jul 12, 2023
1 parent bb206b1 commit 9e6e895
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sanctum/routers/infractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def serialize_infraction(record):
@router.get("/{guild_id}/infractions")
async def get_guild_infractions(guild_id: int, request: Request):
query = """SELECT * FROM infractions
WHERE guild_id=$1;
WHERE guild_id=$1
ORDER BY id ASC;
"""
record = await request.app.pool.fetch(query, guild_id)
if not record:
Expand Down Expand Up @@ -118,7 +119,8 @@ async def get_guild_user_infractions(guild_id: int, member_id: int, request: Req
# A guild user could be a member (the user is still in the guild) or a user (previous member of the guild)
query = """SELECT * FROM infractions
WHERE guild_id=$1
AND user_id=$2;
AND user_id=$2
ORDER BY id ASC;
"""
records = await request.app.pool.fetch(query, guild_id, member_id)
if not records:
Expand Down

0 comments on commit 9e6e895

Please sign in to comment.