Skip to content

Commit

Permalink
fix: don't return deleted comments, resolves OpenTreeHole#134
Browse files Browse the repository at this point in the history
  • Loading branch information
HydrogenC committed Aug 11, 2024
1 parent b29551c commit ad7c728
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions danke/api/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package api

import (
"errors"
"time"

"github.com/gofiber/fiber/v2"
. "github.com/opentreehole/backend/common"
"github.com/opentreehole/backend/common/sensitive"
Expand All @@ -10,7 +12,6 @@ import (
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/plugin/dbresolver"
"time"
)

// GetReviewV1 godoc
Expand Down Expand Up @@ -70,7 +71,7 @@ func ListReviewsV1(c *fiber.Ctx) (err error) {

// 查找评论
var reviews ReviewList
err = DB.Find(&reviews, "course_id = ?", courseID).Error
err = DB.Where("course_id = ? AND deleted_at IS NULL", courseID).Find(&reviews).Error
if err != nil {
return
}
Expand Down

0 comments on commit ad7c728

Please sign in to comment.