Open MilaKomisarenko opened 6 days ago
Reproducible: always
Pre-conditions:
Steps to reproduce:
Choose the PATCH method in Postman.
Add the endpoint {server}/users/{user_id} in the URL field, replacing {server} with the actual server address and {user_id} with the user's ID.
In the Body tab, select the raw type and set the data format to JSON.
Enter the following test data in the body: { "mainSubjects": { "tutor": [ { "_id": "4de73c1f-1377-4723-ab99-484ecc478144", "subjects": [ { "_id": "66758f4059019cd05eb11a98", "name": "Operating Systems" }, { "_id": "66758f4059019cd05eb11a99", "name": "Cybersecurity" } ] } ] } }
Send the request.
Actual result: Status code 500 is returned. { "status": 500, "code": "INTERNAL_SERVER_ERROR", "message": "Cannot read property '_id' of undefined" }
Expected result: Status code 4xx is returned.
Reproducible: always
Pre-conditions:
Steps to reproduce:
Choose the PATCH method in Postman.
Add the endpoint {server}/users/{user_id} in the URL field, replacing {server} with the actual server address and {user_id} with the user's ID.
In the Body tab, select the raw type and set the data format to JSON.
Enter the following test data in the body: { "mainSubjects": { "tutor": [ { "_id": "4de73c1f-1377-4723-ab99-484ecc478144", "subjects": [ { "_id": "66758f4059019cd05eb11a98", "name": "Operating Systems" }, { "_id": "66758f4059019cd05eb11a99", "name": "Cybersecurity" } ] } ] } }
Send the request.
Actual result: Status code 500 is returned. { "status": 500, "code": "INTERNAL_SERVER_ERROR", "message": "Cannot read property '_id' of undefined" }
Expected result: Status code 4xx is returned.