feat(api): implement /users/me/preferences endpoint
All checks were successful
ci/woodpecker/push/web Pipeline was successful
ci/woodpecker/push/api Pipeline was successful

Implements GET/PATCH/PUT /users/me/preferences. Fixes profile page 'Preferences unavailable' error by correcting the /api prefix in frontend calls and adding PATCH handler to controller.

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #539.
This commit is contained in:
2026-02-27 10:51:28 +00:00
committed by jason.woltje
parent b3922e1d5b
commit 833662a64f
5 changed files with 275 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ export default function ProfilePage(): ReactElement {
setPrefsError(null);
try {
const data = await apiGet<UserPreferences>("/users/me/preferences");
const data = await apiGet<UserPreferences>("/api/users/me/preferences");
setPreferences(data);
} catch (err: unknown) {
const message = err instanceof Error ? err.message : "Could not load preferences";

View File

@@ -240,7 +240,7 @@ export default function AppearanceSettingsPage(): ReactElement {
setLocalTheme(themeId);
setSaving(true);
try {
await apiPatch("/users/me/preferences", { theme: themeId });
await apiPatch("/api/users/me/preferences", { theme: themeId });
} catch {
// Theme is still applied locally even if API save fails
} finally {