Skip to content

Resolve "Add an API for setting user mobile on SaaS"

Martin Tan请求将1175-api-for-user-mobile合并到main-jh

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.

Closes #1175

Martin Tan 编辑于

合并请求报告

加载中