function userApiUrl
userApiUrl(
user: { id: string; } | { username: string; },
...segments: string[]
): string

Returns the URL of /api/users/:key, or of what is under it, segments such as "dumps", slug, each encoded: every request about a user takes it from here. The key is user's id, or, when the caller has only the name a page's path gives, @ and that handle, which the API resolves as the page would, a former name or a remote user's included.

Parameters

user: { id: string; } | { username: string; }
...segments: string[]

Return Type

string

Usage

import { userApiUrl } from "src/utils/shared/urls.ts";