Open Atta1122 opened 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"); } })
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"); } })