|
9 | 9 |
|
10 | 10 | "code.gitea.io/gitea/models"
|
11 | 11 | "code.gitea.io/gitea/modules/context"
|
12 |
| - "code.gitea.io/gitea/modules/setting" |
13 | 12 | api "code.gitea.io/gitea/modules/structs"
|
14 | 13 | "code.gitea.io/gitea/routers/api/v1/utils"
|
15 | 14 | )
|
@@ -122,7 +121,7 @@ func IsWatching(ctx *context.APIContext) {
|
122 | 121 | Reason: nil,
|
123 | 122 | CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
|
124 | 123 | URL: subscriptionURL(ctx.Repo.Repository),
|
125 |
| - RepositoryURL: repositoryURL(ctx.Repo.Repository), |
| 124 | + RepositoryURL: ctx.Repo.Repository.APIURL(), |
126 | 125 | })
|
127 | 126 | } else {
|
128 | 127 | ctx.NotFound()
|
@@ -160,7 +159,7 @@ func Watch(ctx *context.APIContext) {
|
160 | 159 | Reason: nil,
|
161 | 160 | CreatedAt: ctx.Repo.Repository.CreatedUnix.AsTime(),
|
162 | 161 | URL: subscriptionURL(ctx.Repo.Repository),
|
163 |
| - RepositoryURL: repositoryURL(ctx.Repo.Repository), |
| 162 | + RepositoryURL: ctx.Repo.Repository.APIURL(), |
164 | 163 | })
|
165 | 164 |
|
166 | 165 | }
|
@@ -195,10 +194,5 @@ func Unwatch(ctx *context.APIContext) {
|
195 | 194 |
|
196 | 195 | // subscriptionURL returns the URL of the subscription API endpoint of a repo
|
197 | 196 | 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" |
204 | 198 | }
|
0 commit comments