diff --git a/sync/service/postgres.go b/sync/service/postgres.go index 1a7cf95..84dbd49 100644 --- a/sync/service/postgres.go +++ b/sync/service/postgres.go @@ -182,11 +182,11 @@ func (p *Postgres) RecursBefore(date time.Time) ([]item.Item, error) { } func (p *Postgres) RecursNext(id string, date time.Time) error { - var item item.Item + var recurrer *item.Recur err := p.db.QueryRow(` - SELECT id, kind, updated, deleted, body, recurrer, recur_next + SELECT recurrer FROM items - WHERE id = $1`, id).Scan(&item.ID, &item.Kind, &item.Updated, &item.Deleted, &item.Body, &item.Recurrer, &item.RecurNext) + WHERE id = $1`, id).Scan(&recurrer) if err != nil { if err == sql.ErrNoRows { return ErrNotFound @@ -194,7 +194,7 @@ func (p *Postgres) RecursNext(id string, date time.Time) error { return fmt.Errorf("%w: %v", ErrPostgresFailure, err) } - if item.Recurrer == nil { + if recurrer == nil { return ErrNotARecurrer }