Spaces:
Running
Running
| from fastapi import APIRouter, HTTPException | |
| from app.services.note_store import get_note, list_notes | |
| router = APIRouter(prefix="/notes", tags=["notes"]) | |
| def get_notes(folder_id: str | None = None): | |
| return list_notes(folder_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 |