File size: 445 Bytes
cddfa37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import APIRouter, HTTPException
from app.services.note_store import get_note, delete_note


router = APIRouter(prefix="/notes", tags=["notes"])


@router.delete("/{note_id}")
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
    }