Backend: edit/delete endpoints for vocabularies, terms, and authorities #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The admin reference-data surface currently exposes create + list only:
GET/POST /api/admin/vocabulariesGET/POST /api/admin/vocabularies/{id}/termsGET/POST /api/admin/authorities?kind=Frontend Milestone 4 (vocabulary & authority management) was therefore deliberately scoped to create + list — there is no UI to rename a vocabulary, correct a term's labels/URI, fix a misspelled authority, or remove an erroneous entry. In a cataloguing system this is a real operational gap: reference data accrues mistakes that currently can only be fixed by direct DB edits.
Ask
Add update/delete endpoints (and the corresponding
db/apilayer functions), e.g.:PATCH /api/admin/vocabularies/{id}(renamekey) — or decide keys are immutable and document whyPATCH /api/admin/vocabularies/{id}/terms/{term_id}(edit labels /external_uri)DELETE /api/admin/vocabularies/{id}/terms/{term_id}PATCH /api/admin/authorities/{id}(edit labels /external_uri)DELETE /api/admin/authorities/{id}Considerations
Acceptance
Done in
873efe1(merged tomain). Added auditedPATCH/DELETEfor terms, vocabularies (rename), and authorities. Referenced-entity deletes are blocked with 409 + count (JSONB scan ofobject.fields); vocabulary delete is blocked when it has terms or is bound by a field definition. Frontend: in-place edit +AlertDialogdelete on the vocabularies and authorities screens, surfacing the "used by N" message. Field definitions are covered by #36 (same milestone).