summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user')
-rw-r--r--routers/api/v1/user/watch.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go
index 2a94e219fe..8bf4eeb505 100644
--- a/routers/api/v1/user/watch.go
+++ b/routers/api/v1/user/watch.go
@@ -5,8 +5,6 @@
package user
import (
- "time"
-
api "code.gitea.io/sdk/gitea"
"code.gitea.io/gitea/models"
@@ -14,16 +12,6 @@ import (
"code.gitea.io/gitea/modules/setting"
)
-// WatchInfo contains information about a watched repository
-type WatchInfo struct {
- Subscribed bool `json:"subscribed"`
- Ignored bool `json:"ignored"`
- Reason interface{} `json:"reason"`
- CreatedAt time.Time `json:"created_at"`
- URL string `json:"url"`
- RepositoryURL string `json:"repository_url"`
-}
-
// getWatchedRepos returns the repos that the user with the specified userID is
// watching
func getWatchedRepos(userID int64, private bool) ([]*api.Repository, error) {
@@ -67,7 +55,7 @@ func GetMyWatchedRepos(ctx *context.APIContext) {
// specified in ctx
func IsWatching(ctx *context.APIContext) {
if models.IsWatching(ctx.User.ID, ctx.Repo.Repository.ID) {
- ctx.JSON(200, WatchInfo{
+ ctx.JSON(200, api.WatchInfo{
Subscribed: true,
Ignored: false,
Reason: nil,
@@ -87,7 +75,7 @@ func Watch(ctx *context.APIContext) {
ctx.Error(500, "WatchRepo", err)
return
}
- ctx.JSON(200, WatchInfo{
+ ctx.JSON(200, api.WatchInfo{
Subscribed: true,
Ignored: false,
Reason: nil,