ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

GetAttachment fails if id is passed as an argument

Open bladerunner2020 opened this issue 3 years ago • 1 comments
trafficstars

I need to load attachments by their IDs.

   const attachmentId = ... // getting an attachment id somehow
   exch.GetAttachment(attachmentId).then((res) => {
     // expecting to get here
  })

This code fails as I need to pass it an attachment structure or array of attachment structure. I think it would be nice if you add check for type of first argument - if it's a string or array of strings, use

  ExtensionMethods_1.ArrayHelper.AddRange(request.AttachmentIds, attachments);

bladerunner2020 avatar Aug 10 '22 06:08 bladerunner2020

I believe this is due to missing "Operator Overloading" in javascript as compared to c#

gautamsi avatar Aug 15 '22 15:08 gautamsi