feat: Expose level progress percentage in profile API response #144
@ -41,9 +41,12 @@ four ways to sign requests.
|
|||||||
method="GET",
|
method="GET",
|
||||||
path="/profile/{username}",
|
path="/profile/{username}",
|
||||||
title="View a profile",
|
title="View a profile",
|
||||||
summary="Render a user profile, including an online-presence indicator (JSON exposes profile_online and profile_user.last_seen). Returns an HTML page.",
|
summary="Render a user profile, including an online-presence indicator (JSON exposes profile_online, profile_user.last_seen, xp_next_level, and xp_progress_pct). Returns an HTML page.",
|
||||||
auth="public",
|
auth="public",
|
||||||
interactive=True,
|
interactive=True,
|
||||||
|
notes=[
|
||||||
|
"Level progress: `xp_next_level = level * 100` (total XP needed), `xp_progress_pct = xp % 100` (percentage towards next level). Both are also embedded in `profile_user`.",
|
||||||
|
],
|
||||||
params=[
|
params=[
|
||||||
field(
|
field(
|
||||||
"username",
|
"username",
|
||||||
@ -793,3 +796,4 @@ four ways to sign requests.
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user