mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 22:50:51 +00:00
fix(audit): name automatic dose recording in medication audit rows
Switching autoMarkTaken on or off now appears in the medication.update row with its previous value, and medication.create records whether the medication starts with doses recorded automatically.
This commit is contained in:
1 parent
fe782493a1
commit
38900656a3
3 files changed
+63
-1
No files matched your search
@@ -1134,6 +1134,9 @@ export const PUT = apiHandler(
|
||||
active: existing.active,
|
||||
asNeeded: existing.asNeeded,
|
||||
trackIntake: existing.trackIntake,
|
||||
// v1.42.2 — switching automatic recording on or off is a change
|
||||
// to how doses are recorded, so the row names it.
|
||||
autoMarkTaken: existing.autoMarkTaken,
|
||||
endsOn: existing.endsOn,
|
||||
},
|
||||
after: {
|
||||
@@ -1142,6 +1145,7 @@ export const PUT = apiHandler(
|
||||
active: medication.active,
|
||||
asNeeded: medication.asNeeded,
|
||||
trackIntake: medication.trackIntake,
|
||||
autoMarkTaken: medication.autoMarkTaken,
|
||||
endsOn: medication.endsOn,
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -491,7 +491,13 @@ async function postMedication(request: NextRequest): Promise<Response> {
|
||||
await auditLog("medication.create", {
|
||||
userId: user.id,
|
||||
ipAddress: getClientIp(request),
|
||||
details: { medicationId: medication.id, name },
|
||||
details: {
|
||||
medicationId: medication.id,
|
||||
name,
|
||||
// v1.42.2 — a medication created with its doses recorded
|
||||
// automatically says so in its audit row.
|
||||
autoMarkTaken: medication.autoMarkTaken,
|
||||
},
|
||||
});
|
||||
|
||||
annotate({
|
||||
|
||||
Reference in new issue
Block a user