These are chat archives for Automattic/mongoose

10th
Oct 2018
Cois-Backeljau
@Developerken6
Oct 10 2018 13:01
someone here, who has a little time to review my code? I'm having a mongoose/mongo problem and i think its in my routes, but i can't figure out where or how.
Kev
@lineus
Oct 10 2018 13:02
@Developerken6 sure, just post a link to a gist or a repo ( or share the route in question here )
Cois-Backeljau
@Developerken6
Oct 10 2018 13:14
@lineus i will soon as i figured it out how to upload my project ot github, sorry kinda new to all this
Kev
@lineus
Oct 10 2018 13:21
@Developerken6 no worries, I'll be stepping away for a couple of hours. If no one helps in the meantime I'll take a look as soon as I get back to my desk :smile:
Cois-Backeljau
@Developerken6
Oct 10 2018 13:23
@lineus https://github.com/Developerken6/todo/blob/master/app.js my routes are still in the app.js file
i've managed to upload them :-p
Cois-Backeljau
@Developerken6
Oct 10 2018 16:31
@lineus i guess it has something to do with line 119 or 120. because everytime when i want to add a 2nd item to the DB the rest dissappears...
Kev
@lineus
Oct 10 2018 18:05
@Developerken6 there's an error in your HTML in your todo.ejs
you have 2 forms on the page, but the first one doesn't have a closing tag. This is somehow causing the 2nd form to send a delete api call.
I also reordered the routes to have the most specific route of each type (e.g. app.get('/index/:id' above app.get('/index' )
Screen Shot 2018-10-10 at 2.09.17 PM.png
Cois-Backeljau
@Developerken6
Oct 10 2018 18:10
@lineus OMG, i feel like a dumbass now... damn...
huge thanks ! did not noticed this at all
Kev
@lineus
Oct 10 2018 18:11
don't. It took me almost an hour to figure out :)
Cois-Backeljau
@Developerken6
Oct 10 2018 18:17
I also reordered the routes to have the most specific route of each type (e.g. app.get('/index/:id' above app.get('/index' )you mean in app.js ?
Kev
@lineus
Oct 10 2018 18:23
I was thinking of another problem I helped with in express a while back when I did that. you are probably safe to leave yours as it is and forget I ever said anything :)
but yeah, I was referring to app.js
Cois-Backeljau
@Developerken6
Oct 10 2018 20:28
Any tips are welcome. I'm still learning, and i should learn it the good way from the start ;-)