feat(profile): persist and expose the date-format preference

Accept dateFormat on the profile PATCH field-by-field, echo it from
the profile + /me reads, mirror it into the client auth user, and add
the field to the OpenAPI request/response schemas.
This commit is contained in:
Marc-André Bombeck committed 2026-06-26 12:15:09 +02:00
1 parent 37e539d0bf
commit 86a9ca2e1e
10 files changed
+57 -1

No files matched your search

+3
View File
@@ -42,6 +42,7 @@ export const GET = apiHandler(async () => {
locale: true,
timezone: true,
timeFormat: true,
dateFormat: true,
moodReminderEnabled: true,
fullName: true,
insurerName: true,
@@ -77,6 +78,7 @@ export const GET = apiHandler(async () => {
locale: dbUser?.locale ?? null,
timezone: dbUser?.timezone ?? "Europe/Berlin",
timeFormat: dbUser?.timeFormat ?? "AUTO",
dateFormat: dbUser?.dateFormat ?? "AUTO",
moodReminderEnabled: dbUser?.moodReminderEnabled ?? false,
fullName: dbUser?.fullName ?? null,
insurerName: dbUser?.insurerName ?? null,
@@ -114,6 +116,7 @@ export const PATCH = apiHandler(async (request: NextRequest) => {
locale: result.user.locale,
timezone: result.user.timezone,
timeFormat: result.user.timeFormat,
dateFormat: result.user.dateFormat,
moodReminderEnabled: result.user.moodReminderEnabled,
fullName: result.user.fullName,
insurerName: result.user.insurerName,