summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-21 15:48:53 +0200
committerGitHub <noreply@github.com>2020-04-21 14:48:53 +0100
commitbb4261a5ed678235fadef279fe1ba1505993a406 (patch)
treee3134123a4ccd273ddf5cd93701fef6db21d593b /models/issue.go
parent33176e8d27eeb47c6d63fbd24bf11ac9e5c60acd (diff)
downloadgitea-bb4261a5ed678235fadef279fe1ba1505993a406.tar.gz
gitea-bb4261a5ed678235fadef279fe1ba1505993a406.zip
Add issue subscription check to API (#10967)
close #10962 Adds `GET /api/v1​/repos​/{owner}​/{repo}​/issues​/{index}​/subscriptions​/check` -> return a `WachInfo`
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 17ec0a6888..de7ac8c9f0 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -332,6 +332,13 @@ func (issue *Issue) GetIsRead(userID int64) error {
// APIURL returns the absolute APIURL to this issue.
func (issue *Issue) APIURL() string {
+ if issue.Repo == nil {
+ err := issue.LoadRepo()
+ if err != nil {
+ log.Error("Issue[%d].APIURL(): %v", issue.ID, err)
+ return ""
+ }
+ }
return fmt.Sprintf("%s/issues/%d", issue.Repo.APIURL(), issue.Index)
}