import json


def change_user_details(client, userid, **kwargs):
    """
    Changes the details of an existing user
    :param client: the client to make the request
    :param userid: the user whose details need changing
    :param kwargs: the details that need to be changed
    :return:
    """
    return client.patch(f'/api/auth/user/{userid}',
                        data=json.dumps(kwargs),
                        content_type='application/json')