This pull request introduces input validation checks for the book creation and update endpoints in our application. It ensures that all required fields are present and that the year field passes a specific validation function before proceeding with the creation or update of a book record.
Summary
Added input validation for the POST / and PUT /:id endpoints in the routes/book.routes.js file.
Validation checks for the presence of title, author, year, category, and cover fields.
Includes a specific validation for the year field using a validateInput function.
If any field is missing or the year field fails validation, the API responds with a 400 status code and a descriptive error message.
Fixes #148.
🎉 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 input validation checks for the book creation and update endpoints in our application. It ensures that all required fields are present and that the
year
field passes a specific validation function before proceeding with the creation or update of a book record.Summary
POST /
andPUT /:id
endpoints in theroutes/book.routes.js
file.title
,author
,year
,category
, andcover
fields.year
field using avalidateInput
function.year
field fails validation, the API responds with a400
status code and a descriptive error message.Fixes #148.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.