When trying to update a location, if the name did not change, then the BrAPI code would throw a validation error because there is already a location with the same name in the database (the one trying to be updated). Updated the code to look for any other locations that have the same name and not the same ID as the location trying to be updated.
Testing
Create a location via BrAPI (can use DeltaBreed)
Make a PUT call to update the newly created location. Make sure to NOT update the name.
Verify save is successful
Create two locations via BrAPI (can use DeltaBreed)
Try to update one of the locations to have the same name as the other
Verify the save fails
Checklist
[ ] Refactoring only
[ ] Documentation only
[ ] Fixture update only
[x] Bug fix
[ ] The relevant issue has been closed.
[ ] Further work is required.
[ ] New feature
[ ] Relevant tests have been created and run.
[ ] Data was added to the fixture
[ ] Data was added via a patch in /t/data/fixture/patches/.
[ ] User-Facing Change
[ ] The user manual in /docs has been updated.
[ ] Any new Perl has been documented using perldoc.
[ ] Any new JavaScript has been documented using JSDoc.
[ ] Any new legacy JavaScript has been moved from /js to /js/source/legacy.
Description
When trying to update a location, if the name did not change, then the BrAPI code would throw a validation error because there is already a location with the same name in the database (the one trying to be updated). Updated the code to look for any other locations that have the same name and not the same ID as the location trying to be updated.
Testing
Create a location via BrAPI (can use DeltaBreed)
Make a PUT call to update the newly created location. Make sure to NOT update the name.
Verify save is successful
Create two locations via BrAPI (can use DeltaBreed)
Try to update one of the locations to have the same name as the other
Verify the save fails
Checklist
/t/data/fixture/patches/
./docs
has been updated./js
to/js/source/legacy
.