Skip to content

Commit 150912f

Browse files
committed
Remove WatchInfo and link to api struct
1 parent d409d3a commit 150912f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

routers/api/v1/user/watch.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,13 @@
55
package user
66

77
import (
8-
"time"
9-
108
api "code.gitea.io/sdk/gitea"
119

1210
"code.gitea.io/gitea/models"
1311
"code.gitea.io/gitea/modules/context"
1412
"code.gitea.io/gitea/modules/setting"
1513
)
1614

17-
// WatchInfo contains information about a watched repository
18-
type WatchInfo struct {
19-
Subscribed bool `json:"subscribed"`
20-
Ignored bool `json:"ignored"`
21-
Reason interface{} `json:"reason"`
22-
CreatedAt time.Time `json:"created_at"`
23-
URL string `json:"url"`
24-
RepositoryURL string `json:"repository_url"`
25-
}
26-
2715
// getWatchedRepos returns the repos that the user with the specified userID is
2816
// watching
2917
func getWatchedRepos(userID int64, private bool) ([]*api.Repository, error) {
@@ -67,7 +55,7 @@ func GetMyWatchedRepos(ctx *context.APIContext) {
6755
// specified in ctx
6856
func IsWatching(ctx *context.APIContext) {
6957
if models.IsWatching(ctx.User.ID, ctx.Repo.Repository.ID) {
70-
ctx.JSON(200, WatchInfo{
58+
ctx.JSON(200, api.WatchInfo{
7159
Subscribed: true,
7260
Ignored: false,
7361
Reason: nil,
@@ -87,7 +75,7 @@ func Watch(ctx *context.APIContext) {
8775
ctx.Error(500, "WatchRepo", err)
8876
return
8977
}
90-
ctx.JSON(200, WatchInfo{
78+
ctx.JSON(200, api.WatchInfo{
9179
Subscribed: true,
9280
Ignored: false,
9381
Reason: nil,

0 commit comments

Comments
 (0)