mirror of
https://github.com/a-mayb3/Kanban_clone_backend.git
synced 2026-03-21 10:05:38 +01:00
Fixed confusion in project creation between sqlalchemy and pydantic model
This commit is contained in:
parent
48b2bcfa70
commit
1b84af0025
1 changed files with 2 additions and 2 deletions
|
|
@ -115,14 +115,14 @@ def create_project(project: ProjectCreate, request:Request, db: db_dependency):
|
|||
return db_project
|
||||
|
||||
|
||||
@router.post("/{project_id}/tasks", response_model=ProjectTaskCreate, tags=["tasks"])
|
||||
@router.post("/{project_id}/tasks", response_model=ProjectTaskBase, tags=["tasks"])
|
||||
def create_project_task(project_id: int, task: TaskCreate, db: db_dependency, request: Request):
|
||||
"""Create a new task in a specified project"""
|
||||
user = get_user_from_jwt(request, db)
|
||||
|
||||
db_project = get_project_by_id_for_user(user, project_id, db)
|
||||
|
||||
db_task = ProjectTaskCreate(
|
||||
db_task = Task(
|
||||
title=task.title,
|
||||
description=task.description,
|
||||
status=task.status,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue