Added delete and get parent project routes

This commit is contained in:
Hannah dagemark 2026-08-06 22:54:49 +02:00
commit b6f4eddb42
2 changed files with 16 additions and 1 deletions

View file

@ -1,6 +1,6 @@
from fastapi import APIRouter
from app.logic.project_logic import create, get_all, get_by_id, get_with_parent
from app.logic.project_logic import create, delete, get_all, get_by_id, get_with_parent
from app.models.project import Project
router = APIRouter(prefix="/projects", tags=["projects"])
@ -23,6 +23,16 @@ def get_project_by_id(project_id: int):
return get_by_id(project_id)
@router.get("/parent/{parent_id}")
def get_project_by_parent_id(parent_id: int):
return get_with_parent(parent_id)
@router.post("/")
def create_project(project: Project):
return create(project)
@router.delete("/{project_id}")
def delete_project(project_id: int):
return delete(project_id)