mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 22:50:51 +00:00
Merge branch 'feat/v144-settings' into release/v1.44.0
# Conflicts: # src/components/settings/privacy-section.tsx
This commit is contained in:
commit
e1b70537cc
129 files changed
+5138
-3169
No files matched your search
@@ -2154,6 +2154,8 @@ const accountSettingsBackupSchema = z
|
||||
medicationListLayoutJson: z.unknown().optional(),
|
||||
moodTagLayoutJson: z.unknown().optional(),
|
||||
documentsLayoutJson: z.unknown().optional(),
|
||||
moduleListLayoutJson: z.unknown().optional(),
|
||||
previewFeaturesJson: z.unknown().optional(),
|
||||
reportSelectionJson: z.unknown().optional(),
|
||||
globalExcludedInjectionSites: z.array(z.string()).optional(),
|
||||
healthKitConfigJson: z.unknown().optional(),
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Request schemas for the per-user Settings preferences that are not part of
|
||||
* the account payload: the list presentation of the labs, illness and
|
||||
* checkups lists, and the preview-feature opt-ins. Shared by the routes and
|
||||
* the OpenAPI registry so the wire contract has one source.
|
||||
*/
|
||||
import { z } from "zod/v4";
|
||||
|
||||
import {
|
||||
MODULE_LIST_ID_MAX,
|
||||
MODULE_LIST_KEYS,
|
||||
MODULE_LIST_ORDER_MAX,
|
||||
MODULE_LIST_VIEWS,
|
||||
MODULE_SORT_DIRS,
|
||||
} from "@/lib/settings/module-list-layout";
|
||||
|
||||
export const moduleListLayoutPutSchema = z
|
||||
.object({
|
||||
version: z.literal(1),
|
||||
list: z.enum(MODULE_LIST_KEYS),
|
||||
view: z.enum(MODULE_LIST_VIEWS).optional(),
|
||||
order: z
|
||||
.array(z.string().min(1).max(MODULE_LIST_ID_MAX))
|
||||
.max(MODULE_LIST_ORDER_MAX)
|
||||
.optional(),
|
||||
sortDir: z.enum(MODULE_SORT_DIRS).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
export const previewFeaturesPatchSchema = z
|
||||
.object({
|
||||
topics: z.boolean().optional(),
|
||||
})
|
||||
.strict()
|
||||
.refine((body) => Object.keys(body).length > 0, {
|
||||
message: "Name at least one preview feature.",
|
||||
});
|
||||
Reference in new issue
Block a user