Resolve "Add an API for setting user mobile on SaaS"
Related upstream MR
What does this MR do and why?
To let administrators have the ability to update user phone, we need to add this admin only API on JiHu SaaS.
A tech debt issue #1415 is also created to handle phone encryption and decryption on model level.
Why not contribute to upstream
The phone
is a JiHu SaaS only field, that's why we are not going to expose phone
to user show
and edit
api like PUT {{APP_PATH}}/api/v4/users/58
.
Proposal
-
Add an APIs to set and get user mobile for admin -
This API should be JH SaaS only -
Only available for Administrators
APIs
Show User Phone
GET {{APP_PATH}}/api/v4/users/57/phone
Response
{
"id": 57,
"username": "test_02",
"name": "t t2",
"phone": "+8614789579341"
}
Update User Phone
PUT {{APP_PATH}}/api/v4/users/57/phone
Payload
phone:+8614789579341
Response
{
"id": 57,
"username": "test_02",
"name": "t t2",
"phone": "+8614789579341"
}
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #1175