feat(api): sort members in sql

This commit is contained in:
Sam 2022-11-20 21:26:19 +01:00
parent 73c5c9fc67
commit 17cc57a31d
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ func (db *DB) UserMember(ctx context.Context, userID xid.ID, memberRef string) (
} }
func (db *DB) UserMembers(ctx context.Context, userID xid.ID) (ms []Member, err error) { func (db *DB) UserMembers(ctx context.Context, userID xid.ID) (ms []Member, err error) {
sql, args, err := sq.Select("*").From("members").Where("user_id = ?", userID).ToSql() sql, args, err := sq.Select("*").From("members").Where("user_id = ?", userID).OrderBy("name", "id").ToSql()
if err != nil { if err != nil {
return nil, errors.Wrap(err, "building sql") return nil, errors.Wrap(err, "building sql")
} }