Display accounts sorted by name
This commit is contained in:
@ -43,6 +43,7 @@ func (q *Queries) GetAccount(ctx context.Context, id uuid.UUID) (Account, error)
|
||||
const getAccounts = `-- name: GetAccounts :many
|
||||
SELECT accounts.id, accounts.budget_id, accounts.name FROM accounts
|
||||
WHERE accounts.budget_id = $1
|
||||
ORDER BY accounts.name
|
||||
`
|
||||
|
||||
func (q *Queries) GetAccounts(ctx context.Context, budgetID uuid.UUID) ([]Account, error) {
|
||||
@ -75,6 +76,7 @@ LEFT JOIN transactions ON transactions.account_id = accounts.id
|
||||
WHERE accounts.budget_id = $1
|
||||
AND transactions.date < NOW()
|
||||
GROUP BY accounts.id, accounts.name
|
||||
ORDER BY accounts.name
|
||||
`
|
||||
|
||||
type GetAccountsWithBalanceRow struct {
|
||||
|
Reference in New Issue
Block a user