mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
move notification APIFormat (#13783)
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user