fix: only upload attachments that are files
This commit is contained in:
parent
b3f1ed596c
commit
fa7d565238
2 changed files with 18 additions and 14 deletions
|
@ -103,20 +103,22 @@ impl Actor for ImportCardActor {
|
|||
.result?
|
||||
.attachments;
|
||||
for trello_attachment in attachments.into_iter() {
|
||||
let trello_attachment_name = trello_attachment.name.clone();
|
||||
let child = spawn_in_thread!(
|
||||
actor_ref,
|
||||
ImportAttachmentActor::new(
|
||||
this.ctx.clone(),
|
||||
this.nextcloud_board_id,
|
||||
this.nextcloud_stack_id,
|
||||
nextcloud_card.id,
|
||||
this.trello_card.id.clone(),
|
||||
trello_attachment,
|
||||
)
|
||||
);
|
||||
this.attachments_children
|
||||
.insert(child.id(), (trello_attachment_name, child.clone()));
|
||||
if trello_attachment.is_upload {
|
||||
let trello_attachment_name = trello_attachment.name.clone();
|
||||
let child = spawn_in_thread!(
|
||||
actor_ref,
|
||||
ImportAttachmentActor::new(
|
||||
this.ctx.clone(),
|
||||
this.nextcloud_board_id,
|
||||
this.nextcloud_stack_id,
|
||||
nextcloud_card.id,
|
||||
this.trello_card.id.clone(),
|
||||
trello_attachment,
|
||||
)
|
||||
);
|
||||
this.attachments_children
|
||||
.insert(child.id(), (trello_attachment_name, child.clone()));
|
||||
}
|
||||
}
|
||||
|
||||
if this.labels_children.is_empty() && this.attachments_children.is_empty() {
|
||||
|
|
|
@ -26,4 +26,6 @@ pub(crate) struct TrelloAttachment {
|
|||
pub(crate) url: TrelloAttachmentUrl, //"https://admin.typeform.com/form/RzExEM/share#/link",
|
||||
#[serde(rename = "fileName")]
|
||||
pub(crate) file_name: TrelloAttachmentFilename,
|
||||
#[serde(rename = "isUpload")]
|
||||
pub(crate) is_upload: bool,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue