I have a web part in SPFx for SharePoint Online which displays list items and any attachments on those list items. The code seems to take quite a while (maybe a third of a second per attachment)
Is there any way to speed things up?
Thanks P
ViewXml: this.properties.camlQuery,
});
// look through the returned items.
for (var i = 0; i < r.length; i++) {
console.log('ID:' + r[i]["ID"]);
//const item: IItem = sp.web.lists.getByTitle(this.properties.listName).items.getById(Number(r[i]["ID"]));
console.log('got by id');
// get all the attachments
const attachmentInfo: IAttachmentInfo[] = await item.attachmentFiles();
console.log('got attachmentInfo');
attachmentInfo.map(file=>{
var fileUrl=file.ServerRelativeUrl;
console.log('fileUrl:' + fileUrl);
})