Skip to content

Commit cf91cfb

Browse files
sapkappleboy
authored andcommitted
Migrate WatchInfo struct to api (#1492)
* Remove WatchInfo and link to api struct * Add vendor temporary update * Return to gitea vendor source
1 parent 237270e commit cf91cfb

File tree

5 files changed

+142
-18
lines changed

5 files changed

+142
-18
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,

vendor/code.gitea.io/sdk/gitea/issue_comment.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/code.gitea.io/sdk/gitea/repo_watch.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/code.gitea.io/sdk/gitea/status.go

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/vendor.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"revisionTime": "2017-04-07T07:44:04Z"
1010
},
1111
{
12-
"checksumSHA1": "32qRX47gRmdBW4l4hCKGRZbuIJk=",
12+
"checksumSHA1": "7/pZpgSIh/M76hwvldhgRqege/Q=",
1313
"path": "code.gitea.io/sdk/gitea",
14-
"revision": "9ceaabb8c70aba1ff73718332db2356356e26ffb",
15-
"revisionTime": "2017-03-09T22:08:57Z"
14+
"revision": "cad003b49151391f9a22f2e2edb2f348f51f9dde",
15+
"revisionTime": "2017-04-15T14:32:48Z"
1616
},
1717
{
1818
"checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=",

0 commit comments

Comments
 (0)