Example #1
0
// UpdateCommentOnLocation updates a comment of an location.
func UpdateCommentOnLocation(c *gin.Context) (int, error) {
	location := &model.Location{}
	status, err := commentService.UpdateComment(c, location)
	if err != nil {
		return status, err
	}
	status, err = UpdateLocationCommentCount(location)
	if err != nil {
		return status, err
	}
	return http.StatusOK, err
}
Example #2
0
// UpdateCommentOnArticle updates a comment on an article.
func UpdateCommentOnArticle(c *gin.Context) (int, error) {
	article := &model.Article{}
	status, err := commentService.UpdateComment(c, article)
	if err != nil {
		return status, err
	}
	status, err = UpdateArticleCommentCount(article)
	if err != nil {
		return status, err
	}
	return http.StatusOK, err
}