Files
HealthLog/tests
Marc-André Bombeck 31253ff615 fix(labs): let a marker without a unit be edited
A marker minted from a text result (OCR, CSV import, inbound document)
stores an empty unit: none has been chosen yet, and its first numeric
reading sets it. The editor read that empty unit as a unit still to be
typed and refused to save, ticking "No unit" sent "1", and the update
route refused any unit change on a marker with readings. Every save of
such a marker failed, a plain rename included, because the form always
sent the unit.

- The form opens an empty unit with "No unit" ticked and sends the unit
  only when it changed; the empty unit and the unity count as the same
  "no unit" there, so a rename leaves the stored unit as it is.
- PUT /api/biomarkers/{id} locks the unit only on a real change while
  numeric readings exist (deleted ones included). Another spelling of
  the stored unit is no change, and text results carry no number the
  unit could misstate, so a text-only marker may take any unit.
- The empty unit stays distinct from "1": it still adopts the unit of
  its first number, which "1" must not. No stored value changes.

Refs #1393
2026-11-15 23:32:18 +01:00
..