Skip to content

Commit

Permalink
Merge pull request #151 from ppolariss/main
Browse files Browse the repository at this point in the history
feat: add warning notification when floor.SensitiveDetail is empty
  • Loading branch information
JingYiJun authored Jul 9, 2024
2 parents b27d5ec + a0ab56b commit 5d809fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/floor.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,14 @@ func (floor *Floor) SendSensitive(_ *gorm.DB) error {
}

// construct message
description := floor.SensitiveDetail
if description == "" {
description = "error: sensitive detail is empty!!!"
}
message := Notification{
Data: floor,
Recipients: userIDs,
Description: floor.SensitiveDetail,
Description: description,
Title: "您有待审核的内容",
Type: MessageTypeSensitive,
URL: fmt.Sprintf("/api/floors/%d", floor.ID),
Expand Down

0 comments on commit 5d809fd

Please sign in to comment.