return full comment on create request
This commit is contained in:
@@ -10,6 +10,7 @@ Remark42 is a self-hosted, lightweight, and simple (yet functional) comment engi
|
||||
* Voting and pinning system
|
||||
* Sortable comments
|
||||
* Extractor for recent comments, cross-post
|
||||
* RSS for all comments and each post
|
||||
* Export data to json with automatic backups
|
||||
* No external databases, everything embedded in a single data file
|
||||
* Fully dockerized and can be deployed in a single command
|
||||
|
||||
@@ -187,9 +187,15 @@ func (s *Rest) createCommentCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// DataService modifies comment
|
||||
finalComment, err := s.DataService.Get(comment.Locator, id)
|
||||
if err != nil {
|
||||
rest.SendErrorJSON(w, r, http.StatusInternalServerError, err, "can't load created comment")
|
||||
return
|
||||
}
|
||||
s.Cache.Flush() // reset all caches
|
||||
render.Status(r, http.StatusCreated)
|
||||
render.JSON(w, r, JSON{"id": id, "locator": comment.Locator})
|
||||
render.JSON(w, r, &finalComment)
|
||||
}
|
||||
|
||||
func (s *Rest) previewCommentCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user