mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-09 18:54:19 +00:00
[GITEA] Add Upload URL to release API
- Resolves https://codeberg.org/forgejo/forgejo/issues/580 - Return a `upload_field` to any release API response, which points to the API URL for uploading new assets. - Adds unit test. - Adds integration testing to verify URL is returned correctly and that upload endpoint actually works (cherry picked from commit074413a2dc) (cherry picked from commit33feed4723) (cherry picked from commit1ca21b95ff) (cherry picked from commit874f07cec2) (cherry picked from commita78c538d8e) (cherry picked from commitbef38ce382) (cherry picked from commitc8eb345354)
This commit is contained in:
parent
5bb2c54b6f
commit
b1efc0032a
6 changed files with 79 additions and 0 deletions
|
|
@ -133,6 +133,11 @@ func (r *Release) HTMLURL() string {
|
|||
return r.Repo.HTMLURL() + "/releases/tag/" + util.PathEscapeSegments(r.TagName)
|
||||
}
|
||||
|
||||
// APIUploadURL the api url to upload assets to a release. release must have attributes loaded
|
||||
func (r *Release) APIUploadURL() string {
|
||||
return r.APIURL() + "/assets"
|
||||
}
|
||||
|
||||
// Link the relative url for a release on the web UI. release must have attributes loaded
|
||||
func (r *Release) Link() string {
|
||||
return r.Repo.Link() + "/releases/tag/" + util.PathEscapeSegments(r.TagName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue