mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
api: Support user_id in get_user_presence_endpoint.
This is part of our general process of replacing emails, which are not static with time, with user_ids when referring to users in the API. We still keep the `email` reference option, since it can be useful for linking third-party applications to Zulip on an intranet that might have a user's corporate email handy and not want to do the extra round trip to lookup the user. The name of the parameter, user_id_or_email, was chosen to to make it clear that the default/preferred option is user_id. Fixes #14304.
This commit is contained in:
@@ -140,7 +140,7 @@ def test_authorization_errors_fatal(client: Client, nonadmin_client: Client) ->
|
||||
validate_against_openapi_schema(result, "/users/me/subscriptions", "post", "400_1")
|
||||
|
||||
|
||||
@openapi_test_function("/users/{email}/presence:get")
|
||||
@openapi_test_function("/users/{user_id_or_email}/presence:get")
|
||||
def get_user_presence(client: Client) -> None:
|
||||
|
||||
# {code_example|start}
|
||||
@@ -148,7 +148,7 @@ def get_user_presence(client: Client) -> None:
|
||||
result = client.get_user_presence("iago@zulip.com")
|
||||
# {code_example|end}
|
||||
|
||||
validate_against_openapi_schema(result, "/users/{email}/presence", "get", "200")
|
||||
validate_against_openapi_schema(result, "/users/{user_id_or_email}/presence", "get", "200")
|
||||
|
||||
|
||||
@openapi_test_function("/users/me/presence:post")
|
||||
|
||||
Reference in New Issue
Block a user