Submit images from service.Create only after creation in Engine

This commit is contained in:
vdimir
2020-07-09 12:43:07 -05:00
committed by Umputun
parent 9957ab642b
commit d7c9aecf03
+2 -1
View File
@@ -101,7 +101,8 @@ func (s *DataStore) Create(comment store.Comment) (commentID string, err error)
comment.PostTitle = title
}()
s.submitImages(comment)
defer s.submitImages(comment) // submit images only after creation in Engine
if e := s.AdminStore.OnEvent(comment.Locator.SiteID, admin.EvCreate); e != nil {
log.Printf("[WARN] failed to send create event, %s", e)
}