summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/notify
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-02 10:24:35 +0100
committerGitHub <noreply@github.com>2020-12-02 09:24:35 +0000
commit4f5ff1ef080f73c1374126effb2b4fc249c0bd6c (patch)
treefbd3fa6f9b709224f844aac81604d9d1b88a9284 /routers/api/v1/notify
parent4569339a4b8ead2b9bb110f4b7fc393ef6b3b4ba (diff)
downloadgitea-4f5ff1ef080f73c1374126effb2b4fc249c0bd6c.tar.gz
gitea-4f5ff1ef080f73c1374126effb2b4fc249c0bd6c.zip
move notification APIFormat (#13783)
Diffstat (limited to 'routers/api/v1/notify')
-rw-r--r--routers/api/v1/notify/repo.go3
-rw-r--r--routers/api/v1/notify/threads.go3
-rw-r--r--routers/api/v1/notify/user.go3
3 files changed, 6 insertions, 3 deletions
diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go
index cc66e0f743..0a75fcd30a 100644
--- a/routers/api/v1/notify/repo.go
+++ b/routers/api/v1/notify/repo.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/routers/api/v1/utils"
)
@@ -127,7 +128,7 @@ func ListRepoNotifications(ctx *context.APIContext) {
return
}
- ctx.JSON(http.StatusOK, nl.APIFormat())
+ ctx.JSON(http.StatusOK, convert.ToNotifications(nl))
}
// ReadRepoNotifications mark notification threads as read on a specific repo
diff --git a/routers/api/v1/notify/threads.go b/routers/api/v1/notify/threads.go
index 86ae2dca31..efe5bcb59c 100644
--- a/routers/api/v1/notify/threads.go
+++ b/routers/api/v1/notify/threads.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/convert"
)
// GetThread get notification by ID
@@ -44,7 +45,7 @@ func GetThread(ctx *context.APIContext) {
return
}
- ctx.JSON(http.StatusOK, n.APIFormat())
+ ctx.JSON(http.StatusOK, convert.ToNotificationThread(n))
}
// ReadThread mark notification as read by ID
diff --git a/routers/api/v1/notify/user.go b/routers/api/v1/notify/user.go
index 373c88d372..e739c6a38d 100644
--- a/routers/api/v1/notify/user.go
+++ b/routers/api/v1/notify/user.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/routers/api/v1/utils"
)
@@ -87,7 +88,7 @@ func ListNotifications(ctx *context.APIContext) {
return
}
- ctx.JSON(http.StatusOK, nl.APIFormat())
+ ctx.JSON(http.StatusOK, convert.ToNotifications(nl))
}
// ReadNotifications mark notification threads as read, unread, or pinned