Estoy creando una función que toma una matriz filtrada y genera un TextBlock en una tarjeta adaptable con los cumpleaños de los usuarios (Persona y fecha de nacimiento), escribí el código pero tengo un error: [onTurnError] error no controlado: Error: Payload Es incorrecto
este es un archivo teamsBot.js
if (invokeValue.action.verb === "event5") { const res = await axios.get("https://365.sharepoint.com/sites/Manage/_api/Web/Lists(guid'')/Items", { headers: { 'Authorization': 'Bearer token' } }) console.log(res); let today = new Date(); // const tmp1 = res.data.value.filter(item => moment(item.field_4).format('MM') === moment(today).format('MM')); // console.log(tmp1); const tmp1 = res.data.value.map(val => { return{ name: val.field_1, bdate: new Date(val.field_4) } }) const currentMonth = (new Date()).getMonth() const filtredEmployees = tmp1.filter(employee => { return employee.bdate.getMonth() === currentMonth }) console.log(filtredEmployees); const card = cards.card1(tmp1); await context.sendActivity({ attachments: [CardFactory.adaptiveCard(card)] }); return { statusCode: 200 }; }y esto es cards.js
const card1 = (tmp1) => { return[ { "contentType": "application/vnd.microsoft.card.adaptive", "content":{ "type": "AdaptiveCard", "version": "1.4", "body": [ tmp1.map(item => { return( { "type": "TextBlock", "text": item.bdate, "wrap": true } ) }) ], "actions": [ { "type": "Action.Execute", "title": "На главную", "verb": "hello", "fallback": "Action.Submit" } ] } } ] } module.exports.cards = { card1: card1 }