This pull request introduces a new endpoint to the application, allowing users to retrieve books by author name. It also includes tests to ensure the functionality works as expected.
Summary
Added a new endpoint /books/author/:authorName in app.js to fetch books by author name. This endpoint is case-insensitive and matches partial author names.
Implemented error handling for the new endpoint to return a 500 status code with a message in case of failure.
Added a new test file booksByAuthor.test.js with tests that:
Check if the endpoint correctly retrieves books for an existing author.
Verify that an empty array is returned for authors that do not exist in the database.
Ensure proper handling and response for invalid author names, expecting a 400 status code.
Utilized chai and chai-http for writing and executing the tests.
Fixes #60.
🎉 Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request introduces a new endpoint to the application, allowing users to retrieve books by author name. It also includes tests to ensure the functionality works as expected.
Summary
/books/author/:authorName
inapp.js
to fetch books by author name. This endpoint is case-insensitive and matches partial author names.booksByAuthor.test.js
with tests that:chai
andchai-http
for writing and executing the tests.Fixes #60.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.