-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach to release #673
Attach to release #673
Conversation
@@ -309,7 +309,7 @@ func runWeb(ctx *cli.Context) error { | |||
return | |||
} | |||
}) | |||
m.Post("/issues/attachments", repo.UploadIssueAttachment) | |||
m.Post("/attachments", repo.UploadIssueAttachment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change UploadIssueAttachment
to UploadAttachment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, will change the function name. The function repo.UploadIssueAttachment
does nothing to do with Issues.
For future reference I changed this because I saw three options:
- Have releases uploading attachments to
/issues/attachments
- add
/releases/attachments
and point to the same function or copy/paste function - rationalise it and change the existing URL to just
/attachments
Given that the GET url is already /attachments
the third option seemed the most rational.
But cannot delete attachments? |
@lunny That's correct. I've left it out because there is no delete function for attachments against issues either. I think that should be a separate issue / PR to implement as this PR feels weighty enough and this PR doesn't make the situation any worse. I've created #677 and will look to create a new PR for it when I get time. |
LGTM |
LGTM |
Implemented attaching files to a release as requested in #282
There is already a field in the Attachment table which is unused not used called ReleaseID. This allows an attachment to be associated with a release. This PR:
/issues/attachments
to/attachments
(the GET url was already/attachments
)