mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
feat(workouts): edit a hand-entered workout from its detail page
A workout logged by hand could only be deleted and logged again. The detail page now offers an edit control beside delete for a MANUAL workout carrying the form's `manual:` id, in one's own record. It opens the log sheet on the stored values and saves by re-posting that id through `POST /api/workouts/batch`, which already applies such a re-post as an overwrite of that one row. No new route. The overwrite nulls every overwritable column a re-post leaves out, and the form has no fields for heart rate, steps, elevation or pauses. The edit therefore sends those back as stored. A field left as shown sends the stored value rather than one re-parsed from its display, so saving an untouched edit keeps the start's seconds and a distance shown in miles at its exact metres, and answers `duplicate`. The detail read's `avgHr` / `maxHr` can come from a same-session twin; the read now also serves the row's own `storedAvgHr` / `storedMaxHr`, which is what the edit sends back.
This commit is contained in:
1 parent
ba99551faa
commit
2731c46399
13 files changed
+717
-22
No files matched your search
@@ -45064,6 +45064,22 @@ components:
|
||||
minimum: -9007199254740991
|
||||
maximum: 9007199254740991
|
||||
- type: "null"
|
||||
storedAvgHr:
|
||||
description: The row's own average heart rate (v1.42). `avgHr` may be filled in from a same-session twin by the
|
||||
canonical picker; this is the stored value, which an edit of a hand-entered workout sends back so the twin's
|
||||
value is not written onto it.
|
||||
anyOf:
|
||||
- type: integer
|
||||
minimum: -9007199254740991
|
||||
maximum: 9007199254740991
|
||||
- type: "null"
|
||||
storedMaxHr:
|
||||
description: The row's own maximum heart rate (v1.42), as `storedAvgHr` is to `avgHr`.
|
||||
anyOf:
|
||||
- type: integer
|
||||
minimum: -9007199254740991
|
||||
maximum: 9007199254740991
|
||||
- type: "null"
|
||||
stepCount:
|
||||
anyOf:
|
||||
- type: integer
|
||||
|
||||
Reference in new issue
Block a user