[JITERA] Add Author Routes for CRUD Operations
Overview
This pull request introduces new routes for managing authors in the application. The routes allow for the creation, retrieval, updating, and deletion of author records.
Changes
-
Added Author Routes:
- Implemented routes for creating, reading, updating, and deleting authors.
- The routes are defined in
src/routes/authorRoutes.js.
-
GET /authors:
- Fetches a list of all authors from the database.
-
GET /authors/:id:
- Fetches a single author by their ID.
-
POST /authors:
- Allows the creation of a new author. Expects author details in the request body.
-
PUT /authors/:id:
- Updates an existing author's details based on the provided ID.
-
DELETE /authors/:id:
- Deletes an author from the database based on the provided ID.
Testing
- All routes have been tested using Postman to ensure they function as expected.
- Added validation to ensure that the required fields are provided when creating or updating an author.
This implementation will enhance the application's ability to manage authors effectively.