aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/notify
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-05-03 02:27:42 +0000
committerGitHub <noreply@github.com>2022-05-02 21:27:42 -0500
commitc8ec2261a99590f15699e9147a28e4b61c1c2ea5 (patch)
tree572db0bce06c6d07187e8c285b01325dfa70c63a /routers/api/v1/notify
parent438646e0b55138d2b18313142072236e8f178c29 (diff)
downloadgitea-c8ec2261a99590f15699e9147a28e4b61c1c2ea5.tar.gz
gitea-c8ec2261a99590f15699e9147a28e4b61c1c2ea5.zip
Fix sending empty notifications (#19589)
- Don't send empty notifications on read notifications API.
Diffstat (limited to 'routers/api/v1/notify')
-rw-r--r--routers/api/v1/notify/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go
index a36bbc6b42..0f6b90b05d 100644
--- a/routers/api/v1/notify/repo.go
+++ b/routers/api/v1/notify/repo.go
@@ -214,7 +214,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
targetStatus = models.NotificationStatusRead
}
- changed := make([]*structs.NotificationThread, len(nl))
+ changed := make([]*structs.NotificationThread, 0, len(nl))
for _, n := range nl {
notif, err := models.SetNotificationStatus(n.ID, ctx.Doer, targetStatus)