Spaces:
Sleeping
Sleeping
Download app/api/notes/notes_delete.py from bichnhan2701/NoteServicesAPI: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/api/notes/notes_delete.py
- Command line
-
hf download hf://spaces/bichnhan2701/NoteServicesAPI/app/api/notes/notes_delete.py
-
curl -L -o notes_delete.py https://huggingface.co/spaces/bichnhan2701/NoteServicesAPI/resolve/main/app/api/notes/notes_delete.py
445 Bytes
| from fastapi import APIRouter, HTTPException | |
| from app.services.note_store import get_note, delete_note | |
| router = APIRouter(prefix="/notes", tags=["notes"]) | |
| def delete_note_api(note_id: str): | |
| note = get_note(note_id) | |
| if not note: | |
| raise HTTPException(status_code=404, detail="Note not found") | |
| delete_note(note_id) | |
| return { | |
| "note_id": note_id, | |
| "deleted": True | |
| } | |