Skip to content

Commit 89b0711

Browse files
committed
Merge branch 'master' into release
2 parents 5e518cd + bd479fb commit 89b0711

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/controllers/comments/recent.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"coursebench-backend/pkg/database"
2323
"coursebench-backend/pkg/errors"
2424
"coursebench-backend/pkg/models"
25+
2526
"github.com/gofiber/fiber/v2"
2627
)
2728

@@ -34,13 +35,13 @@ func RecentComment(c *fiber.Ctx) (err error) {
3435
db := database.GetDB()
3536
var comments []models.Comment
3637
err = db.Preload("User").Preload("CourseGroup").Preload("CourseGroup.Course").Preload("CourseGroup.Teachers").
37-
Order("update_time DESC").Limit(30).Find(&comments).Error
38+
Order("update_time DESC").Limit(100).Find(&comments).Error
3839
if err != nil {
3940
return errors.Wrap(err, errors.DatabaseError)
4041
}
4142
var likeResult []CommentLikeResult
4243
if uid != 0 {
43-
db.Raw("SELECT comment_likes.comment_id, comment_likes.is_like from comments, comment_likes where comment_likes.user_id = ? and comment_likes.comment_id = comments.id and comment_likes.deleted_at is NULL and comments.deleted_at is NULL order by create_time desc LIMIT 30",
44+
db.Raw("SELECT comment_likes.comment_id, comment_likes.is_like from comments, comment_likes where comment_likes.user_id = ? and comment_likes.comment_id = comments.id and comment_likes.deleted_at is NULL and comments.deleted_at is NULL order by create_time desc LIMIT 100",
4445
uid).Scan(&likeResult)
4546
}
4647
var response []CommentResponse

0 commit comments

Comments
 (0)