Tell us what’s happening:
I’ve started working on the issue tracker project and currently im working on the post endpoint. Im abale to pass 1/3 tests; the one where it returns error when one of the required fields are missing but the other 2 tests for returning the object are not passing. I’ve added my api code below:
It is probably just Replit restarting the server when it crashes (which is super dumb but that is what they do).
You can add the --watch flag to the start script "node --watch server.js" or install nodemon and use it. That should pause the execution after the crash.
You are finding by a property that isn’t in your Schema project which causes it to be ignored and return everything.
If you set the strictQuery option to 'throw' in the IssueSchema creation it should throw an error instead. You have to catch it, or at least log it, inside IssueModel.find to see it.
IssueModel.find(filterObject, (error, finddata) => {
console.log(error) // StrictModeError: Path "project" is not in schema and strictQuery is 'throw'.
//...code
You have another error that will throw but with the change to the start script you should at least be able to see it now.