mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
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:
parent
0afab87631
commit
d76d67de23
4 changed files with 28 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue