-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
π§© Task: Create an endpoint to manage categories
Create an endpoint for Manage Category in:
π‘ API Endpoints β Category Management
| Method | Endpoint | Description | Request Body (if applicable) |
|---|---|---|---|
| POST | /categories |
Create a new category | CategoryRequest JSON payload |
| GET | /categories |
Get all categories | No need to paginate |
| GET | /categories/:id |
Get a category by ID | - |
| PUT | /categories/:id |
Update an existing category | CategoryRequest JSON payload |
| DELETE | /categories |
Delete single or multiple categories | JSON with ids and forceDelete flag |
π§Ύ Reference: Follows the same structure as
/owners (DELETE)API
π§Ύ README: https://github.com/thanthtooaung-coding/lms-grpc/blob/main/README.md
𧨠DELETE /categories β Request Body Format
{
"ids": [
"uuid-1",
"uuid-2"
],
"forceDelete": true
}idsβ Array of Categories IDs to delete.forceDeleteβ Boolean flag:true: force delete even if linked.false: only delete if no constraint.
πΏ Git Workflow Instructions
1. Sync with dev branch
Before starting work:
git checkout dev
git pull origin dev2. Create a new feature branch
git switch -c ft/cms1-493. Make your changes
Work on your task as described above.
4. Add and commit your changes
Use git commit to create a conventional commit message:
git add . or git add file1.go file2.go
git commit -m "your commit-message"β Write the appropriate commit message with your changes
5. Push your branch
git push origin ft/cms1-49β Once done
Open a Pull Request to dev and request a review.
Let me know if you want me to generate a scaffold or example code block for any part of this!