Bouhadda Mohammed
Bouhadda Mohammed

Reputation: 1

Automatic response header writing in nodeJS

I'm having a problem with a controller (create), each db call made using mongoose (look at the service) will automatically write to response headers with no manual control over it, that's leading to problems when i want to return from the controller to end the response with whether a success or an error.

also in the frontend side, it's just returning the Cannot Post /api/places error, even tho the request is being processed by the backend.

location: src/modules/places/places.controller.ts -> PlacesController.create

commit: 4b9fe368fda75d08b20c7dbbc1576553b1abb39a link: https://github.com/DjoCoding/airbnb-clone/

i tried to disable the the headersSent flag in the response object, but it's a readonly property.

Upvotes: -2

Views: 28

Answers (0)

Related Questions