L'API crash quand on cherche à mettre à jour les données d'un utilisateurs.
Endpoint: POST /user
Node renvoie le code suivant :
/home/vldsite/Social-Co2/server/apiroutes/user.js:266
if (typeof recycl !== 'boolean' || typeof nb_inhabitants !== 'number' || typeof area !== 'number' || typeof garden !== 'boolean' || typeof multiplier !== 'number' || typeof car !== 'number' || typeof hybrid !== 'boolean' || typeof heating !== 'string') {
^
ReferenceError: Cannot access 'multiplier' before initialization
at /home/vldsite/Social-Co2/server/apiroutes/user.js:266:124
at Layer.handle [as handle_request] (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/layer.js:95:5)
at next (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/route.js:144:13)
at next (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/route.js:140:7)
at next (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/route.js:140:7)
at next (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/route.js:140:7)
at Route.dispatch (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/route.js:114:3)
at Layer.handle [as handle_request] (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/layer.js:95:5)
at /home/vldsite/Social-Co2/server/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/home/vldsite/Social-Co2/server/node_modules/express/lib/router/index.js:346:12)
Node.js v18.19.0
L'API crash quand on cherche à mettre à jour les données d'un utilisateurs. Endpoint: POST /user
Node renvoie le code suivant :