Files
zoneminder/web/api/app/Model
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
..
2021-02-02 23:19:52 -05:00
2019-12-20 14:56:14 -05:00
2018-03-13 22:28:38 -04:00
2014-11-15 19:03:40 +00:00
2016-05-02 10:41:25 -04:00
2023-02-26 17:04:05 -05:00
2018-05-07 14:09:05 -07:00
2023-11-03 13:33:28 -04:00
2020-09-10 13:31:39 -04:00