Trim payee name when too long

This commit is contained in:
Jan Bader 2024-01-29 22:51:16 +01:00
parent 2559d2dbdb
commit 4d04529ae2

View File

@ -24,6 +24,9 @@ type CreatePayeeParams struct {
}
func (q *Queries) CreatePayee(ctx context.Context, arg CreatePayeeParams) (Payee, error) {
if len(arg.Name) > 50 {
arg.Name = arg.Name[:50]
}
row := q.db.QueryRowContext(ctx, createPayee, arg.Name, arg.BudgetID)
var i Payee
err := row.Scan(&i.ID, &i.BudgetID, &i.Name)