Delete transaction when amount is zero

This commit is contained in:
2022-02-25 22:33:58 +00:00
parent ae9e9d34c9
commit 05099e469f
4 changed files with 21 additions and 11 deletions

View File

@ -294,17 +294,15 @@ UPDATE transactions
SET date = $1,
memo = $2,
amount = $3,
account_id = $4,
payee_id = $5,
category_id = $6
WHERE id = $7
payee_id = $4,
category_id = $5
WHERE id = $6
`
type UpdateTransactionParams struct {
Date time.Time
Memo string
Amount numeric.Numeric
AccountID uuid.UUID
PayeeID uuid.NullUUID
CategoryID uuid.NullUUID
ID uuid.UUID
@ -315,7 +313,6 @@ func (q *Queries) UpdateTransaction(ctx context.Context, arg UpdateTransactionPa
arg.Date,
arg.Memo,
arg.Amount,
arg.AccountID,
arg.PayeeID,
arg.CategoryID,
arg.ID,