Cutting first char from comment when testing for spam

This commit is contained in:
rawleyIfowler
2022-02-26 15:08:41 -06:00
parent c296296faf
commit c3a22f498b

View File

@@ -182,7 +182,7 @@ func GetBlogPostById(id string) *models.BlogPost {
func GetCommentsByContent(content string, url string) *[]models.Comment { func GetCommentsByContent(content string, url string) *[]models.Comment {
var comments []models.Comment var comments []models.Comment
err := db.Model(&comments).Where("content like ? and associated_post like ?", "%"+content+"%", url).Scan(&comments).Error err := db.Model(&comments).Where("content like ? and associated_post like ?", "%"+content[1:]+"%", url).Scan(&comments).Error
if err != nil { if err != nil {
return &[]models.Comment{} return &[]models.Comment{}
} }