Skip to content

Commit

Permalink
fix: hide content on first floor of hole created and find sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Mar 29, 2024
1 parent 95f986b commit a37d098
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/hole.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,14 @@ func (hole *Hole) Create(tx *gorm.DB, user *User, tagNames []string) (err error)
firstFloor.SetDefaults()

// index
if !firstFloor.IsSensitive {
if !firstFloor.Sensitive() {
go FloorIndex(FloorModel{
ID: firstFloor.ID,
UpdatedAt: time.Now(),
Content: firstFloor.Content,
})
} else {
firstFloor.Content = ""
}

// store into cache
Expand Down

0 comments on commit a37d098

Please sign in to comment.