mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 06:40:50 +00:00
fix(backups): address restore review findings
This commit is contained in:
1 parent
7eb3b91925
commit
e9507a0c93
8 files changed
+29
-15
No files matched your search
@@ -100,7 +100,7 @@ const handler = apiHandler(
|
||||
details: { reason: "missing_confirmation", backupId: id },
|
||||
});
|
||||
return apiError(
|
||||
"Confirmation token missing — body must include confirm: 'RESTORE'",
|
||||
"Confirmation token missing — restoring user data and included instance-wide settings requires confirm: 'RESTORE'",
|
||||
422,
|
||||
);
|
||||
}
|
||||
@@ -403,13 +403,11 @@ const handler = apiHandler(
|
||||
unit: measurement.unit,
|
||||
source: measurement.source ?? "MANUAL",
|
||||
measuredAt: new Date(measurement.measuredAt),
|
||||
notes: measurement.notes ?? null,
|
||||
notes: null,
|
||||
notesEncrypted:
|
||||
measurement.notesEncrypted !== undefined
|
||||
? measurement.notesEncrypted === null
|
||||
? null
|
||||
: decodeEncryptedBytes(measurement.notesEncrypted)
|
||||
: encryptNote(measurement.notes ?? null),
|
||||
measurement.notesEncrypted == null
|
||||
? encryptNote(measurement.notes ?? null)
|
||||
: decodeEncryptedBytes(measurement.notesEncrypted),
|
||||
externalId: measurement.externalId ?? null,
|
||||
externalSourceVersion: measurement.externalSourceVersion ?? null,
|
||||
glucoseContext: (measurement.glucoseContext ?? null) as never,
|
||||
|
||||
@@ -421,7 +421,7 @@ describe("GET /api/export/full-backup", () => {
|
||||
expect(res.headers.get("content-disposition")).toMatch(/\.json"/);
|
||||
const json = await res.json();
|
||||
expect(json).toMatchObject({
|
||||
schemaVersion: "1",
|
||||
schemaVersion: "2",
|
||||
userId: "user-1",
|
||||
measurements: [],
|
||||
medications: [],
|
||||
|
||||
Reference in new issue
Block a user