fix attachments unit tests
parent
b5e61863c7
commit
3943d4037e
|
@ -43,6 +43,8 @@ class AttachmentController
|
||||||
save: () ->
|
save: () ->
|
||||||
attachment = @.attachment.set('loading', true)
|
attachment = @.attachment.set('loading', true)
|
||||||
|
|
||||||
|
@.onUpdate({attachment: attachment})
|
||||||
|
|
||||||
attachment = @.attachment.merge({
|
attachment = @.attachment.merge({
|
||||||
editable: false,
|
editable: false,
|
||||||
loading: false
|
loading: false
|
||||||
|
|
|
@ -123,9 +123,14 @@ class AttachmentsFullService extends taiga.Service
|
||||||
|
|
||||||
patch = taiga.patch(oldAttachment.get('file'), toUpdateAttachment.get('file'))
|
patch = taiga.patch(oldAttachment.get('file'), toUpdateAttachment.get('file'))
|
||||||
|
|
||||||
return @attachmentsService.patch(toUpdateAttachment.getIn(['file', 'id']), type, patch).then () =>
|
if toUpdateAttachment.get('loading')
|
||||||
@._attachments = @._attachments.set(index, toUpdateAttachment)
|
@._attachments = @._attachments.set(index, toUpdateAttachment)
|
||||||
|
|
||||||
@.regenerate()
|
@.regenerate()
|
||||||
|
else
|
||||||
|
return @attachmentsService.patch(toUpdateAttachment.getIn(['file', 'id']), type, patch).then () =>
|
||||||
|
@._attachments = @._attachments.set(index, toUpdateAttachment)
|
||||||
|
|
||||||
|
@.regenerate()
|
||||||
|
|
||||||
angular.module("taigaComponents").service("tgAttachmentsFullService", AttachmentsFullService)
|
angular.module("taigaComponents").service("tgAttachmentsFullService", AttachmentsFullService)
|
||||||
|
|
Loading…
Reference in New Issue