Al crear datos con Fetch by javascript, aparecen como Null cuando se muestran en la pantalla, pero Postman lo hace de manera normal. ¿Puedes ayudar? El ID también se muestra normalmente en el html, pero el autor y el txt no se muestran.
export const listPhrases = async (req: Request, res: Response) => { let list = await Phrase.findAll({}) res.json({list}) } export const createPhrase = async (req: Request, res: Response) => { let { author, txt} = req.body; let newPhrase = await Phrase.create({ author, txt }); res.status(201); res.json({ id: newPhrase.id, author, txt }); } async function getPhrases () { const response = await fetch('http://localhost:4000/frases') const data = await response.json() const phrase = await (data.list) let newPhrases = ''; phrase.forEach(((item) => { let newPhrasesPost = ` <h5>${item.txt}</h5>` newPhrases += newPhrasesPost })) document.getElementById("phrase").innerHTML = newPhrases; } async function newPhrase() { let inputPhrase = document.getElementById("inputPhrase").value; let author = document.getElementById("author").value; let phrasePost = { inputPhrase, author }; const options = { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(phrasePost) }; const response = await fetch("http://localhost:4000/frases", options); getPhrases(); }