Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product comment #655

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

idehen-divine
Copy link

fixes #654

- Implemented `createComment` method to allow users to add comments on products.
- Implemented `updateComment` method to enable users to update their own comments.
- Added validation for comment length and user authorization for updates.
- Ensured proper response handling for missing products or unauthorized actions.

This enhances user engagement by allowing feedback on products.
- Added `POST /organisations/{org_id}/products/{product_id}/comments` to create a product comment.
- Added `PUT /organisations/{product_id}/comments/{comment_id}` to update an existing product comment.
- Linked routes to `createComment` and `updateComment` methods in `ProductController`.

This change enables users to add and modify comments on products within an organization.
- Created `ProductComment` model
- Defined fillable attributes: `comment`, `product_id`, `user_id`
- Added relationships to `Product` and `User` models
- Implemented feature tests for product comments
- Added test for creating a new product comment
- Added test for updating an existing product comment
- Ensured database assertions for created and updated comments
- Included authentication and organization ownership checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Product Comments Endpoints (Create & Update)
1 participant