mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
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:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user