[JITERA] Implement Search Module for Books
Created by: chi-jitera
Overview
This pull request introduces a search module that allows users to find books based on various criteria such as title, author, or genre. The implementation includes updates to the service, controller, and routes to facilitate this new functionality.
Changes Made
-
Add Search Functionality in
bookService.js:- Implemented a new function that searches for books based on the provided criteria (title, author, genre). This function queries the book database and returns matching results.
-
Add Search Endpoint in
bookController.js:- Created a new endpoint that handles incoming search requests. This endpoint utilizes the search function from
bookService.jsto process the search and return the results to the client.
- Created a new endpoint that handles incoming search requests. This endpoint utilizes the search function from
-
Define Search Route in
bookRoutes.js:- Added a new route that maps to the search endpoint in the controller. This route allows clients to make GET requests to search for books.
-
Update
server.jsto Include Search Functionality:- No changes were needed in
server.jsas it already includes the routes frombookRoutes.js. The new search route is automatically included in the server configuration.
- No changes were needed in
These changes enhance the book module by providing users with the ability to search for books, improving the overall user experience.