5
5
package user
6
6
7
7
import (
8
- "time"
9
-
10
8
api "code.gitea.io/sdk/gitea"
11
9
12
10
"code.gitea.io/gitea/models"
13
11
"code.gitea.io/gitea/modules/context"
14
12
"code.gitea.io/gitea/modules/setting"
15
13
)
16
14
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
-
27
15
// getWatchedRepos returns the repos that the user with the specified userID is
28
16
// watching
29
17
func getWatchedRepos (userID int64 , private bool ) ([]* api.Repository , error ) {
@@ -67,7 +55,7 @@ func GetMyWatchedRepos(ctx *context.APIContext) {
67
55
// specified in ctx
68
56
func IsWatching (ctx * context.APIContext ) {
69
57
if models .IsWatching (ctx .User .ID , ctx .Repo .Repository .ID ) {
70
- ctx .JSON (200 , WatchInfo {
58
+ ctx .JSON (200 , api. WatchInfo {
71
59
Subscribed : true ,
72
60
Ignored : false ,
73
61
Reason : nil ,
@@ -87,7 +75,7 @@ func Watch(ctx *context.APIContext) {
87
75
ctx .Error (500 , "WatchRepo" , err )
88
76
return
89
77
}
90
- ctx .JSON (200 , WatchInfo {
78
+ ctx .JSON (200 , api. WatchInfo {
91
79
Subscribed : true ,
92
80
Ignored : false ,
93
81
Reason : nil ,
0 commit comments