Compare commits

...

2 Commits

Author SHA1 Message Date
c8c430fe7f fix: getUserProfile calls /users/{username}/profile to avoid AP route conflict
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m13s
test / unit (pull_request) Successful in 15m54s
test / integration (pull_request) Failing after 18m39s
2026-05-14 17:39:20 +02:00
ec0e24db8d fix: add GET /users/{username}/profile REST endpoint — AP actor owns /users/{username} 2026-05-14 17:39:19 +02:00
2 changed files with 4 additions and 1 deletions

View File

@@ -25,6 +25,9 @@ pub fn router() -> Router<AppState> {
get(users::get_me_following_list), get(users::get_me_following_list),
) )
.route("/users/me/top-friends", put(social::put_top_friends)) .route("/users/me/top-friends", put(social::put_top_friends))
// /users/{username} is owned by the AP router (returns AP actor JSON for federation).
// The REST user profile lives at /users/{username}/profile to avoid the conflict.
.route("/users/{username}/profile", get(users::get_user))
.route( .route(
"/users/{username}/top-friends", "/users/{username}/top-friends",
get(social::get_top_friends_handler), get(social::get_top_friends_handler),

View File

@@ -187,7 +187,7 @@ export const getMeFollowingList = (token: string) =>
// ── Users ───────────────────────────────────────────────────────────────── // ── Users ─────────────────────────────────────────────────────────────────
export const getUserProfile = (username: string, token: string | null) => export const getUserProfile = (username: string, token: string | null) =>
apiFetch(`/users/${username}`, {}, UserSchema, token); apiFetch(`/users/${username}/profile`, {}, UserSchema, token);
export const getFollowersList = (username: string, token: string | null) => export const getFollowersList = (username: string, token: string | null) =>
apiFetch(`/users/${username}/follower-list`, {}, z.object({ total: z.number(), items: z.array(UserSchema) }), token); apiFetch(`/users/${username}/follower-list`, {}, z.object({ total: z.number(), items: z.array(UserSchema) }), token);