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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user