Updates to api/mail.go
Ensures that item.Attachment information is stored within the backup.
This commit is contained in:
parent
52572f9e88
commit
a7c56a7d24
@ -130,13 +130,18 @@ func (c Mail) GetItem(
|
||||
var errs *multierror.Error
|
||||
|
||||
if *mail.GetHasAttachments() || HasAttachments(mail.GetBody()) {
|
||||
options := &users.ItemMessagesItemAttachmentsRequestBuilderGetRequestConfiguration{
|
||||
QueryParameters: &users.ItemMessagesItemAttachmentsRequestBuilderGetQueryParameters{
|
||||
Expand: []string{"microsoft.graph.itemattachment/item"},
|
||||
},
|
||||
}
|
||||
for count := 0; count < numberOfRetries; count++ {
|
||||
attached, err := c.largeItem.
|
||||
Client().
|
||||
UsersById(user).
|
||||
MessagesById(itemID).
|
||||
Attachments().
|
||||
Get(ctx, nil)
|
||||
Get(ctx, options)
|
||||
if err == nil {
|
||||
mail.SetAttachments(attached.GetValue())
|
||||
break
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user