STEP-Pod-Capstone-Project / Capstone-Project

https://book-book-app.appspot.com
Apache License 2.0
4 stars 0 forks source link

Handling SearchServlet Empty Response #118

Closed antoniolinhart closed 4 years ago

antoniolinhart commented 4 years ago

Description

This PR ensures that empty responses are handled on the backend and do not throw null pointer exceptions. The servlet now returns a 204 No Content in the response if there are no books found given a search query.

I have updated all relevant fetches to the /api/search?searchTerm to ensure no exceptions get thrown due to the response and instead set the array of books to be empty, which is handled specially by each implementation.

In addition, I updated the criteria for componentDidUpdate in the ClubSearchList, which was causing the club page to rerender based on the books searched in the previous search query.

Screenshot of Feature

image

Linked Issue

78