1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add file upload for attachments

This commit is contained in:
Justin Nuß
2014-07-24 15:19:59 +02:00
parent 43e5de7f83
commit bfe5b86004
9 changed files with 132 additions and 303 deletions

View File

@@ -1085,21 +1085,3 @@ func DeleteAttachmentsByComment(commentId int64, remove bool) (int, error) {
return DeleteAttachments(attachments, remove)
}
// AssignAttachment assigns the given attachment to the specified comment
func AssignAttachment(issueId, commentId, attachmentId int64) error {
a, err := GetAttachmentById(attachmentId)
if err != nil {
return err
}
if a.IssueId != issueId {
return ErrAttachmentNotLinked
}
a.CommentId = commentId
_, err = x.Id(a.Id).Update(a)
return err
}