Use type instead of isAccount flag
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -130,7 +130,7 @@ func (q *Queries) GetAccountsWithBalance(ctx context.Context, budgetID uuid.UUID
|
||||
}
|
||||
|
||||
const searchAccounts = `-- name: SearchAccounts :many
|
||||
SELECT accounts.id, accounts.budget_id, accounts.name, true as is_account FROM accounts
|
||||
SELECT accounts.id, accounts.budget_id, accounts.name, 'account' as type FROM accounts
|
||||
WHERE accounts.budget_id = $1
|
||||
AND accounts.name LIKE $2
|
||||
ORDER BY accounts.name
|
||||
@ -142,10 +142,10 @@ type SearchAccountsParams struct {
|
||||
}
|
||||
|
||||
type SearchAccountsRow struct {
|
||||
ID uuid.UUID
|
||||
BudgetID uuid.UUID
|
||||
Name string
|
||||
IsAccount bool
|
||||
ID uuid.UUID
|
||||
BudgetID uuid.UUID
|
||||
Name string
|
||||
Type interface{}
|
||||
}
|
||||
|
||||
func (q *Queries) SearchAccounts(ctx context.Context, arg SearchAccountsParams) ([]SearchAccountsRow, error) {
|
||||
@ -161,7 +161,7 @@ func (q *Queries) SearchAccounts(ctx context.Context, arg SearchAccountsParams)
|
||||
&i.ID,
|
||||
&i.BudgetID,
|
||||
&i.Name,
|
||||
&i.IsAccount,
|
||||
&i.Type,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user