WDI-SEA / project-2-issues

0 stars 0 forks source link

My Post Route is crashing out #62

Closed isaac8069 closed 2 years ago

isaac8069 commented 2 years ago

I had to do an undo all migration. I re-migrated and started to add back users and apartment listings. After I hitting submit, I'm getting the error message: ERR_HTTP_INVALID_STATUS_CODE . It is creating the listing which I can see on my All Listings page and in the database, but the redirect isn't functioning properly anymore. I have looked at my routes, views, and index.js. I can't seem to find the problem. I researched the error message as well. The suggestions I found was to add an error status to my app.get middleware . However, I don't think that is the appropriate solution as I did not have that prior to migration. It seemed to work just fine. Please see the screenshots below:

Screen Shot 2021-11-18 at 12 40 43 PM Screen Shot 2021-11-18 at 12 47 43 PM
TaylorDarneille commented 2 years ago

Do you have a status code attached to the res.render or res.redirect that occurs just before you hit this? The error sounds like it doesn't like. Try removing it?

TaylorDarneille commented 2 years ago

I'm also noticing the "Invalid status code: {apartment: [apartment] }" .... sound like you have that code inside of a res.status?

isaac8069 commented 2 years ago
Screen Shot 2021-11-18 at 1 36 41 PM
TaylorDarneille commented 2 years ago

fixed redirect