Commit Graph
7 Commits
Author SHA1 Message Date
Harsh Singh 561b3810ce fix: API states are keyed on Id so an Id in the body no longer renumbers the state or gives a 500 (#8484) 2026-11-28 12:13:25 -05:00
Harsh Singh df27d2da28 fix: API model rules answer a validation error for a list instead of a 500 (#8425) 2026-11-27 08:41:17 -05:00
Harsh Singh 3de2512ea4 fix: API state delete makes default active when it deletes the active state (#8313) 2026-11-26 08:31:29 -05:00
Jash 1d8abd49f4 fix: API refuses run states named start, stop, restart, status, logrot or version, as the web UI does refs #7329 2026-11-22 06:07:02 +05:30
Jash d0531a5072 fix: return a validation error instead of a 500 for an API state without a definition or a zone without coords refs #5834 2026-11-14 18:57:35 +05:30
nicandClaude Opus 5.5 ed8d648efa fix(api): key States by Id so view, edit and delete work (#5173)
The State model still declared primaryKey = 'Name' from before
zm_update-1.28.99 gave States an Id primary key. The REST routes only
match numeric ids, so states/<id>.json view/edit/delete looked up a
state *named* <id> and always failed, and names don't match the routes.
Through states/edit/<name>.json, edit never set the record id and
inserted a new nameless state instead of updating; view had no
_serialize and returned 500.

Use the default Id key. view serializes the state; edit sets the id,
accepts POST/PUT only and, like add, answers {message: Saved} or the
validation errors (as Monitors and Zones do) instead of an empty flash.
Names must be non-empty and unique, since zmpkg.pl and
states/change/<name> select states by name. index, change and delete
are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:44:00 -04:00
Ubuntu dd9603f70f Merged Angular UI branch API to master 2015-06-11 02:58:58 +00:00