// UpdateArticleLikingCount updates a liking count on article. func UpdateArticleLikingCount(article *model.Article) (int, error) { article.LikingCount = db.ORM.Model(article).Association("Likings").Count() if db.ORM.Save(article).Error != nil { return http.StatusInternalServerError, errors.New("Article liking's count is not updated.") } return http.StatusOK, nil }