I've moved the functions and queries from the users file but I get again the issue about:
(node:33710) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
I tried to debug it but couldn't yet understand why it happens. It's because of the insertIntoDatabase which I move into helper file. For the moment I am still serving insertIntoDatabase from the route so it doesn't break and named it insertIntoDatabase2.
If you have some time could you look into what could be the issue?
Hello @crysfel,
I've moved the functions and queries from the users file but I get again the issue about: (node:33710) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
I tried to debug it but couldn't yet understand why it happens. It's because of the insertIntoDatabase which I move into helper file. For the moment I am still serving insertIntoDatabase from the route so it doesn't break and named it insertIntoDatabase2.
If you have some time could you look into what could be the issue?
Thanks, Stefi