I'm trying to send multiple attachments with Sendgrid with a new promise as below. I want to return an array of objects but I don't understand how to do so. emailAttachments contains my 3 objects, but how can I return the array? Can you tell me what's wrong in my code?
const emailAttachments = []
return new Promise(function(resolve, reject){
    pdfList.map(item => {
        fs.readFile((item.frDoc), (err, data) => {
            if (err) {
              return { handled: false }
            }
            if (data) {
                
                emailAttachments.push({
                    content: data.toString('base64'),
                    filename: `document.pdf`,
                    type: 'application/pdf',
                    disposition: 'attachment'
                })
            }
        });
    })
    resolve(emailAttachments)
})
 
     
     
    