When a duplicate term is entered in controlled vocab CRUD component in Settings, the addition fails with a weird server error. This applies in e.g. Settings > Inventory > Holdings, Holdings type, and Settings > Inventory > Instance, Holdings, Item > Call number type and more (basically everywhere this component is used in both Inventory and User settings.
This story will address fields outlined in the below bug. Additional stories will be created to address other fields.
Steps to Reproduce:
- Log into http://folio-snapshot.aws.indexdata.com as diku_admin
- Go to Settings > Inventory > Holdings, Holdings type, and Settings > Inventory > Instance, Holdings, Item > Call number type
- Create a new term with the same Name as an existing term
The server will respond with the error code which will be handled on the UI
The server responds with:
duplicate key value violates unique constraint "loan_type_name_idx_unique": Key (lower(f_unaccent(jsonb ->> 'name'::text)))=(can circulate) already exists.