feat(api): sort members in sql

This commit is contained in:
Sam 2022-11-20 21:26:19 +01:00
parent 73c5c9fc67
commit 17cc57a31d

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) {
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 {
return nil, errors.Wrap(err, "building sql")
}