ousecTic/pern-todo-app

i have been trying to fellow the tutorial ,and i found this problem !

Opened this issue · 2 comments

Hello guys , i really hope that i can understand or have an answer for this problem i am having right now.
actually i can console.log the whole request , but after adding this part that is coded in min 18:16 => 19:36
"const { description } = req.body;
const newTodo = await pool.query(
"INSERT INTO todo (description) VALUES($1) RETURNING *",
[description]
);
" i find a problem . i have this error message : "Cannot read properties of undefined (reading 'query')"
i ill be rally greatful if there is any explination for that !

can you provide full code of index.js

you havent set up the pool correctly.
Show the code for your db.js where you export the pool module