bichnhan2701's picture
Update note services logic
7402e0f
raw
history blame contribute delete
426 Bytes
from fastapi import APIRouter, HTTPException
from app.services.note_store import get_note, list_notes
router = APIRouter(prefix="/notes", tags=["notes"])
@router.get("")
def get_notes(folder_id: str | None = None):
return list_notes(folder_id)
@router.get("/{note_id}")
def get_note_by_id(note_id: str):
note = get_note(note_id)
if not note:
raise HTTPException(404, "Note not found")
return note