aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/watch.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-04-16 14:51:04 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-04-16 20:51:04 +0800
commitcf91cfb993bed1a412590305f594db81dc83bca8 (patch)
treeacad8c7466cce2097aaec42049f07674fa908124 /routers/api/v1/user/watch.go
parent237270ef50ba00b3007ea10c2302bc240188e092 (diff)
downloadgitea-cf91cfb993bed1a412590305f594db81dc83bca8.tar.gz
gitea-cf91cfb993bed1a412590305f594db81dc83bca8.zip
Migrate WatchInfo struct to api (#1492)
* Remove WatchInfo and link to api struct * Add vendor temporary update * Return to gitea vendor source
Diffstat (limited to 'routers/api/v1/user/watch.go')
-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,