function setUsername
setUsername(
userId: string,
username: string
): User

Names user userId username, keeping the old name as their alias as renameUser describes, and returns them. The caller has checked the name: renameUser checks a local one, and federation-service.ts the handle of a user renamed on their home instance.

Parameters

userId: string
username: string

Return Type

Throws

APIException

404 when there is no such user, 409 when the name is or was someone else's.

Usage

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