-
Notifications
You must be signed in to change notification settings - Fork 0
35 post api sub task #202
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
base: develop
Are you sure you want to change the base?
35 post api sub task #202
Conversation
|
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( |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
Create Sub tasks api
For more detail click