fix: Convert sql.NullString to []byte for JSON unmarshaling
This commit is contained in:
parent
fc2a0e32cf
commit
3646aa0961
|
@ -155,7 +155,7 @@ func (p *Postgres) RecursBefore(date time.Time) ([]item.Item, error) {
|
|||
}
|
||||
if recurrerJSON.Valid && recurrerJSON.String != "" {
|
||||
var recurrer item.Recur
|
||||
if err := json.Unmarshal(recurrerJSON, &recurrer); err != nil {
|
||||
if err := json.Unmarshal([]byte(recurrerJSON.String), &recurrer); err != nil {
|
||||
return nil, fmt.Errorf("%w: %v", ErrPostgresFailure, err)
|
||||
}
|
||||
i.Recurrer = &recurrer
|
||||
|
|
Loading…
Reference in New Issue