Skip to content

cms1-61: Create an endpoint to manage modulesΒ #35

@thanthtooaung-coding

Description

@thanthtooaung-coding

🧩 Task: Create an endpoint to manage modules

Create an endpoint for Manage Module in:

πŸ“‘ API Endpoints – Module Management

Method Endpoint Description Request Body (if applicable)
POST /modules Create a new module ModuleRequest JSON payload
GET /modules Get all modules No need to paginate
GET /modules/:id Get a module by ID -
PUT /modules/:id Update an existing module ModuleRequest JSON payload
DELETE /modules Delete single or multiple modules 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 /modules – Request Body Format

{
  "ids": [
    "uuid-1",
    "uuid-2"
  ],
  "forceDelete": true
}
  • ids – Array of Modules 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 dev

2. Create a new feature branch

git switch -c ft/cms1-61

3. 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-61

βœ… 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!

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions