diff --git a/app/store/service.go b/app/store/service.go index ce9fab8a..7831a3ec 100644 --- a/app/store/service.go +++ b/app/store/service.go @@ -51,7 +51,7 @@ func (s *Service) EditComment(locator Locator, commentID string, text string, ed return comment, err } // edit allowed only once - if !comment.Edit.Timestamp.IsZero() { + if comment.Edit != nil { return comment, errors.Errorf("comment %s already edited at %s", commentID, comment.Edit.Timestamp) } diff --git a/app/store/service_test.go b/app/store/service_test.go index 64b1f7b0..1de37b56 100644 --- a/app/store/service_test.go +++ b/app/store/service_test.go @@ -64,7 +64,7 @@ func TestBoltDB_EditComment(t *testing.T) { t.Logf("%+v", res[0]) assert.Nil(t, err) assert.Equal(t, 2, len(res)) - assert.Equal(t, Edit{}, res[0].Edit) + assert.Nil(t, res[0].Edit) comment, err := b.EditComment(Locator{URL: "https://radio-t.com", SiteID: "radio-t"}, res[0].ID, "xxx", Edit{Summary: "my edit"}) assert.Nil(t, err)