While sending PUT or PATCH request, data in db is not changed. Also, password field is not encrypted if user sends PUT or PATCH request.
Example:
Data Before Request:
{
"id": 1,
"password": "pbkdf2_sha256$390000$VfuYgqjCfyOzCcBMeNSSOI$f0duaRLq4ixA6KMPuGQgvfJBDREvdU4HuudmZ2ouiPo=",
"last_login": "2023-02-16T23:37:41.507302+03:00",
"email": "[email protected]",
"first_name": "Abdulaziz",
"last_name": "Abduvakhobov",
"identity_number": null,
"gender": "M",
"birth_date": "2023-02-15",
"weight": null,
"height": null,
"address": "Istanbul",
"category": 2
}
Client's Request:
curl -X PATCH https://..../api/v1/users/1
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization: Token ${TOKEN}'
-d '{"identity_number": 12345678, "weight": 70, "height": 172}'
Data After Response
{
"id": 1,
"password": "pbkdf2_sha256$390000$VfuYgqjCfyOzCcBMeNSSOI$f0duaRLq4ixA6KMPuGQgvfJBDREvdU4HuudmZ2ouiPo=",
"last_login": "2023-02-16T23:37:41.507302+03:00",
"email": "[email protected]",
"first_name": "Abdulaziz",
"last_name": "Abduvakhobov",
"identity_number": null, // must be changed
"gender": "M",
"birth_date": "2023-02-15",
"weight": null, // must be changed
"height": null, // must be changed
"address": "Istanbul",
"category": 2
}