fix: preserve managed target defaults

- Return effective threshold ranges after managed updates\n- Localize closed Coach and Insights display inventories
This commit is contained in:
Marc-André Bombeck committed 2026-08-06 03:52:49 +02:00
1 parent 247ac8494c
commit 6a1d1dd6e8
10 files changed
+397 -18

No files matched your search

@@ -297,11 +297,16 @@ export const PATCH = apiHandler(
...((current?.thresholdsJson ?? {}) as ThresholdOverridesJson),
...patch.overrides,
};
await prisma.user.update({
const record = await prisma.user.update({
where: { id: access.recordId },
data: { thresholdsJson: toJson(overrides) },
select: { heightCm: true, dateOfBirth: true, gender: true },
});
settings = { overrides };
invalidateUserProfile(access.recordId);
settings = {
overrides,
effective: getAllEffectiveRanges(record, overrides),
};
changed = Object.keys(patch.overrides);
break;
}