Skip to content

Commit

Permalink
fix update check too strict
Browse files Browse the repository at this point in the history
  • Loading branch information
franzmueller committed Jan 10, 2025
1 parent 615f691 commit 7318b7f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/controller/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ func (this *Controller) ReadNotification(token auth.Token, id string) (result mo
}

func (this *Controller) SetNotification(token auth.Token, notification model.Notification) (result model.Notification, err error, errCode int) {
existing, err, errCode := this.db.ReadNotification(token.GetUserId(), notification.Id) // Check existence before set, this already checks for user id
_, err, errCode = this.db.ReadNotification(token.GetUserId(), notification.Id) // Check existence before set, this already checks for user id
if err != nil {
return model.Notification{}, err, errCode
}
if existing.Topic != notification.Topic {
return result, errors.New("change of topic is not allowed"), http.StatusBadRequest
}
settings, err, errCode := this.getSettings(token.GetUserId())
if err != nil {
return model.Notification{}, err, errCode
Expand Down

0 comments on commit 7318b7f

Please sign in to comment.