function updateUser
updateUser(
userId: string,
): Promise<User>

Applies request to user userId and returns the updated user. It trusts request: the routes pick the fields a caller may change. The username changes through renameUser alone, which keeps the old one as an alias. A new password also ends every session opened before it and closes the user's sockets, so the caller must issue fresh tokens if the user is to stay signed in. A description of null keeps the current one.

Parameters

userId: string

Return Type

Promise<User>

Throws

APIException

404 when there is no such user, 409 when the new email belongs to another account.

Usage

import { updateUser } from "api/services/user-service.ts";