Exemple #1
0
// DeleteCommentOnLocation deletes a comment from an comment.
func DeleteCommentOnLocation(c *gin.Context) (int, error) {
	location := &model.Location{}
	status, err := commentService.DeleteComment(c, location)
	if err != nil {
		return status, err
	}
	status, err = UpdateLocationCommentCount(location)
	if err != nil {
		return status, err
	}
	return http.StatusOK, err
}
Exemple #2
0
// DeleteCommentOnArticle deletes a comment from an article.
func DeleteCommentOnArticle(c *gin.Context) (int, error) {
	article := &model.Article{}
	status, err := commentService.DeleteComment(c, article)
	if err != nil {
		return status, err
	}
	status, err = UpdateArticleCommentCount(article)
	if err != nil {
		return status, err
	}
	return http.StatusOK, err
}