Skip to content

Commit

Permalink
fix notification read status (#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Nov 30, 2023
1 parent 2fed810 commit 4dedc10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/account/controllers/debt_controller.go
Expand Up @@ -345,6 +345,8 @@ const (
//languageEn = "en"
languageZh = "zh"
debtChoicePrefix = "debt-choice-"
readStatusLabel = "isRead"
falseStatus = "false"
)

var NoticeTemplateEN = map[int]string{
Expand Down Expand Up @@ -426,6 +428,10 @@ func (r *DebtReconciler) sendNotice(ctx context.Context, user string, oweAmount
ntf.Namespace = namespaces[i]
if _, err := controllerutil.CreateOrUpdate(ctx, r.Client, ntf, func() error {
ntf.Spec = *ntfSpec
if ntf.Labels == nil {
ntf.Labels = make(map[string]string)
}
ntf.Labels[readStatusLabel] = falseStatus
return nil
}); err != nil {
return err
Expand Down

0 comments on commit 4dedc10

Please sign in to comment.