ita-social-projects / SpaceToStudy-BackEnd

MIT License
13 stars 5 forks source link

Fix server error for invalid role parameter in /users/{id} #989

Closed luiqor closed 2 days ago

luiqor commented 4 days ago

Fix invalid role parameter along with valid isEdit parameter in /users/{id} causing an error:

{
"status": 500,
"code": "INTERNAL_SERVER_ERROR",
"message": "Cannot read property 'mainSubjects' of null"
}

Result of fix

Invalid role causes a 422 (validation) Unprocessable Entity error:

image

Invalid isEdit causes a 422 (validation) Unprocessable Entity error:

image

Valid params: image

sonarcloud[bot] commented 4 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
82.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud