ulsdevteam / lcsu

0 stars 0 forks source link

Failed book add does not notify user #31

Open ctgraham opened 5 years ago

ctgraham commented 5 years ago

Scanning an invalid book barcode into the /books/scan/ method does not provide notice of failure to the user.

The redirect happens before the error message is queued: https://github.com/ulsdevteam/lcsu/blob/c59adcfab4159701213f24f1fbd55a122b5a1edd/src/Controller/BooksController.php#L83-L93

We also don't check to see if the Book->save method is successful. This should fail, for example, if a book already in the system is scanned again. https://github.com/ulsdevteam/lcsu/blob/c59adcfab4159701213f24f1fbd55a122b5a1edd/src/Controller/BooksController.php#L64

ctgraham commented 5 years ago

This if statement is still unchecked for failure: https://github.com/ulsdevteam/lcsu/blob/c4ea43fc306a57f18defca7f46c0a56b29954b30/src/Controller/BooksController.php#L64-L82