Spaces:
Running
Running
File size: 426 Bytes
7402e0f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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 |