feat: add shared overview and harden frontend session state (#407)

This commit is contained in:
Daniel Volz
2026-03-10 06:26:03 +01:00
committed by GitHub
parent 733fe2f38a
commit 105eb7bc0d
37 changed files with 3281 additions and 1138 deletions
+3 -2
View File
@@ -350,14 +350,15 @@ export function useMedicationForm(): UseMedicationFormReturn {
const next = { ...prev, [key]: value } as FormState;
if (key === "packageType") {
if (isTubePackageType(value)) {
const nextPackageType = value as FormState["packageType"];
if (isTubePackageType(nextPackageType)) {
next.packCount = "1";
next.packageAmountValue = String(Math.max(1, Number(next.packageAmountValue) || 0));
next.medicationForm = "topical";
next.lifecycleCategory = "treatment_period";
next.doseUnit = "units";
next.packageAmountUnit = "g";
} else if (isLiquidContainerPackageType(value)) {
} else if (isLiquidContainerPackageType(nextPackageType)) {
next.packCount = String(Math.max(1, Number(next.packCount) || 1));
next.packageAmountValue = String(Math.max(1, Number(next.packageAmountValue) || 0));
next.medicationForm = "liquid";