feat: expose url field on issue api. (#982)
* Add api url func. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix: Add unit testing. * fix: conflicts * fix: remove trim * fix: revert test function name.
This commit is contained in:
@ -264,6 +264,11 @@ func (repo *Repository) HTMLURL() string {
|
||||
return setting.AppURL + repo.FullName()
|
||||
}
|
||||
|
||||
// APIURL returns the repository API URL
|
||||
func (repo *Repository) APIURL() string {
|
||||
return setting.AppURL + path.Join("api/v1/repos", repo.FullName())
|
||||
}
|
||||
|
||||
// APIFormat converts a Repository to api.Repository
|
||||
func (repo *Repository) APIFormat(mode AccessMode) *api.Repository {
|
||||
cloneLink := repo.CloneLink()
|
||||
|
Reference in New Issue
Block a user