Skip to content

Conversation

lobsam
Copy link
Member

@lobsam lobsam commented Oct 10, 2025

Create Sub tasks api
For more detail click

@lobsam lobsam requested a review from tenzinsamten October 10, 2025 11:11
@lobsam lobsam self-assigned this Oct 10, 2025
Copy link

from pecha_api.plans.tasks.sub_tasks.plan_sub_tasks_response_model import SubTaskRequest, SubTaskResponse
from pecha_api.plans.tasks.sub_tasks.plan_sub_tasks_services import create_new_sub_tasks

sub_tasks_router = APIRouter(
Copy link
Contributor

@tenzinsamten tenzinsamten Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start then endpoint as cms/sub-tasks

)
)

saved = save_sub_tasks_bulk(db=db, sub_tasks=new_sub_tasks)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better naming , saved_sub_tasks

display_order: int

class SubTaskResponse(BaseModel):
data: List[SubTaskDTO]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from data to subtasks


oauth2_scheme = HTTPBearer()

@sub_tasks_router.post("/task/{task_id}/sub-tasks", status_code=status.HTTP_201_CREATED, response_model=SubTaskResponse)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change here and add the task_id as part of SubTaskRequests, the endpoint should be:
@sub_tasks_router.post("", status_code=status.HTTP_201_CREATED, response_model=SubTaskResponse)

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.

2 participants