mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Attach to release (#673)
* Moved attachaments POST url from /issues/attachments to /attachments * Implemented attachment upload on release page * Implemented downloading attachments on the release page * Added zip and gzip files to default allowed attachments * Implemented uploading attachments on edit release * Renamed UploadIssueAttachment to UploadAttachment
This commit is contained in:
parent
dce03c19cb
commit
64375d875b
11 changed files with 144 additions and 14 deletions
|
@ -99,7 +99,7 @@ func CreateRelease(ctx *context.APIContext, form api.CreateReleaseOption) {
|
|||
IsPrerelease: form.IsPrerelease,
|
||||
CreatedUnix: commit.Author.When.Unix(),
|
||||
}
|
||||
if err := models.CreateRelease(ctx.Repo.GitRepo, rel); err != nil {
|
||||
if err := models.CreateRelease(ctx.Repo.GitRepo, rel, nil); err != nil {
|
||||
if models.IsErrReleaseAlreadyExist(err) {
|
||||
ctx.Status(409)
|
||||
} else {
|
||||
|
@ -145,7 +145,7 @@ func EditRelease(ctx *context.APIContext, form api.EditReleaseOption) {
|
|||
if form.IsPrerelease != nil {
|
||||
rel.IsPrerelease = *form.IsPrerelease
|
||||
}
|
||||
if err := models.UpdateRelease(ctx.Repo.GitRepo, rel); err != nil {
|
||||
if err := models.UpdateRelease(ctx.Repo.GitRepo, rel, nil); err != nil {
|
||||
ctx.Error(500, "UpdateRelease", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue