This commit is contained in:
urieljarethbusiness-cpu
2026-05-19 14:21:56 -06:00
parent 4f3bc01dcb
commit 7361f7ced1
6 changed files with 133 additions and 11 deletions
+9 -1
View File
@@ -8,7 +8,7 @@ from fastapi.responses import FileResponse, PlainTextResponse
from backend.app.config import settings
from backend.app.managers.knowledge_manager import DuplicateSourceError, KnowledgeManager
from backend.app.models.schemas import MarkdownUpdate, SubjectCreate, WeekCreate, WeekUpdate
from backend.app.models.schemas import MarkdownUpdate, SubjectCreate, SubjectUpdate, WeekCreate, WeekUpdate
from backend.app.services.ingestion_service import IngestionService
app = FastAPI(title="Knowledge Station", version="0.1.0")
@@ -60,6 +60,14 @@ def get_subject(subject_id: int) -> dict:
raise HTTPException(status_code=404, detail=str(exc)) from exc
@app.put("/subjects/{subject_id}")
def update_subject(subject_id: int, payload: SubjectUpdate) -> dict:
try:
return manager.update_subject(subject_id, payload.name)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@app.delete("/subjects/{subject_id}")
def delete_subject(subject_id: int) -> dict:
try: