When checking out a physical copy by scanning the physical copy first and then scanning the patron ID, the application creates multiple loans for the same physical copy and then gives an internal server error, crashing the app.
Steps to Reproduce
Go to 'Check-out' tab
Scan the Physical Copy's barcode first
Scan the patron ID on the 'You are about to checkout the physical copy with barcode' popup dialog box
Expected behaviour
Backend: It should only create a single loan.
Frontend: It should only send 1 checkout request to backend.
Package version: v1.0.0-alpha.77
Describe the bug
When checking out a physical copy by scanning the physical copy first and then scanning the patron ID, the application creates multiple loans for the same physical copy and then gives an internal server error, crashing the app.
Steps to Reproduce
Expected behaviour
Backend: It should only create a single loan. Frontend: It should only send 1 checkout request to backend.
Screenshots (if applicable)
https://github.com/inveniosoftware/react-invenio-app-ils/assets/50872172/a666ce9d-2e71-4672-bdcc-eccab7b04f1a