Skip to content

Commit c7ad54c

Browse files
committed
imprufe code [noise]
1 parent 7ca8cbb commit c7ad54c

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

routers/api/v1/user/watch.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"code.gitea.io/gitea/models"
1111
"code.gitea.io/gitea/modules/context"
12-
"code.gitea.io/gitea/modules/setting"
1312
api "code.gitea.io/gitea/modules/structs"
1413
"code.gitea.io/gitea/routers/api/v1/utils"
1514
)
@@ -122,7 +121,7 @@ func IsWatching(ctx *context.APIContext) {
122121
Reason: nil,
123122
CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
124123
URL: subscriptionURL(ctx.Repo.Repository),
125-
RepositoryURL: repositoryURL(ctx.Repo.Repository),
124+
RepositoryURL: ctx.Repo.Repository.APIURL(),
126125
})
127126
} else {
128127
ctx.NotFound()
@@ -160,7 +159,7 @@ func Watch(ctx *context.APIContext) {
160159
Reason: nil,
161160
CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
162161
URL: subscriptionURL(ctx.Repo.Repository),
163-
RepositoryURL: repositoryURL(ctx.Repo.Repository),
162+
RepositoryURL: ctx.Repo.Repository.APIURL(),
164163
})
165164

166165
}
@@ -195,10 +194,5 @@ func Unwatch(ctx *context.APIContext) {
195194

196195
// subscriptionURL returns the URL of the subscription API endpoint of a repo
197196
func subscriptionURL(repo *models.Repository) string {
198-
return repositoryURL(repo) + "/subscription"
199-
}
200-
201-
// repositoryURL returns the URL of the API endpoint of a repo
202-
func repositoryURL(repo *models.Repository) string {
203-
return setting.AppURL + "api/v1/" + repo.FullName()
197+
return repo.APIURL() + "/subscription"
204198
}

0 commit comments

Comments
 (0)