1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

[API] add endpoint to check notifications [Extend #9488] (#9595)

* introduce GET /notifications/new

* add TEST

* use Sprintf instead of path.Join

* Error more verbose

* return number of notifications if unreaded exist

* 200 http status for available notifications
This commit is contained in:
6543
2020-01-14 16:37:19 +01:00
committed by Antoine GIRARD
parent ce274d652f
commit 44de66bf50
9 changed files with 107 additions and 5 deletions

View File

@@ -8,7 +8,6 @@ package models
import (
"fmt"
"path"
"strings"
"code.gitea.io/gitea/modules/git"
@@ -249,7 +248,7 @@ func (c *Comment) APIURL() string {
return ""
}
return c.Issue.Repo.APIURL() + "/" + path.Join("issues/comments", fmt.Sprint(c.ID))
return fmt.Sprintf("%s/issues/comments/%d", c.Issue.Repo.APIURL(), c.ID)
}
// IssueURL formats a URL-string to the issue