CodeWithHarry / iNotebook-React

INotebook is a React Application for managing personal notes on the cloud
343 stars 193 forks source link

Note.find is not a function #29

Open Atta1122 opened 2 years ago

Atta1122 commented 2 years ago

yar kase ye error solve karo notes.js me ye error aya he ==> Note.find is not a function

// ROUTE 1: Get All the Notes using: GET "/api/auth/getuser". Login required router.get('/fetchallnotes', fetchuser, async (req, res) => { try { const notes = await Note.find({ user: req.user }); res.json(notes) } catch (error) { console.error(error.message); res.status(500).send("Internal Server Error"); } })