a.b
(a.b.)
August 26, 2022, 9:34am
1
hello everybody, im trying to code along this project “local book library” but with"ejs" as a “view engine”
so far it’s going alright, but in this tutorial my “on submit” even is showing me “casting error” and as it’s als mentioned there might be a “casting error” and i tried to address that in my “view code” as they suggested author._id.toString()===book.author._id.toString()
but im still getting that “Casting Error”
Create Book form - Learn web development | MDN
here is my current attempted code for it:
bookController: Intro-to-node-js/external-resources/assignments/mdn-express/local-library-tutorial/controllers/bookController.js at d00bd0fb2902546e79b26b6f3707f0faf0187783 · bappyasif/Intro-to-node-js · GitHub
viewFile: Intro-to-node-js/external-resources/assignments/mdn-express/local-library-tutorial/views/book_form.ejs at d00bd0fb2902546e79b26b6f3707f0faf0187783 · bappyasif/Intro-to-node-js · GitHub
please help me fix this, any feedback is appreciated, thanks for looking into this, much appreciated
Varade19
(Kushagra)
August 26, 2022, 1:09pm
2
Can you help me in understanding?
What is the data structure?
Is the data loaded when you are trying to access this?
1 Like
a.b
(a.b.)
August 29, 2022, 4:24pm
3
thanks but i managed to solve it already, i should have been here earlier
basically i was looking at a “different” scope for that “error” affecting “code”, classic rookie mistake
Hi a.b.,
Did you run into a “Casting Error” when setting up the genreContoller.js code for the call back to render the Genre Detail Page?
I’ve run into a Casting Error when using the findById() method using the “req.params.id”.
And i can’t figure out the fix.
Thoughts?