Add file upload for attachments
This commit is contained in:
parent
43e5de7f83
commit
bfe5b86004
9 changed files with 132 additions and 303 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue