This pull request introduces new endpoints and a model to manage work information in the API, aligning with the specified requirements to create, retrieve, update, and delete work information.
Adds a new Work model: Implements a Work class in models.py with fields for id, title, description, and user_id, including a relationship to the User model.
Implements work-related endpoints: Updates routes.py to include endpoints for creating (POST /works), retrieving (GET /works/{work_id}), updating (PUT /works/{work_id}), and deleting (DELETE /works/{work_id}) work information. These endpoints handle the necessary CRUD operations and error handling for non-existent work IDs.
Updates documentation: Modifies README.md to document the new work endpoints, detailing request and response formats for managing work information, thereby providing users with the necessary information to interact with these new API features.
Related to #7
This pull request introduces new endpoints and a model to manage work information in the API, aligning with the specified requirements to create, retrieve, update, and delete work information.
Work
model: Implements aWork
class inmodels.py
with fields forid
,title
,description
, anduser_id
, including a relationship to theUser
model.routes.py
to include endpoints for creating (POST /works
), retrieving (GET /works/{work_id}
), updating (PUT /works/{work_id}
), and deleting (DELETE /works/{work_id}
) work information. These endpoints handle the necessary CRUD operations and error handling for non-existent work IDs.README.md
to document the new work endpoints, detailing request and response formats for managing work information, thereby providing users with the necessary information to interact with these new API features.For more details, open the Copilot Workspace session.