Jotzy/backend/app/models.py

17 lines
381 B
Python
Raw Normal View History

2025-11-19 21:16:32 +00:00
# backend/app/models.py
from typing import Dict, List
# Inmemory “database”
_notes: List[Dict] = [] # each note is a dict with id, title, body
def add_note(title: str, body: str) -> Dict:
note_id = len(_notes) + 1
note = {"id": note_id, "title": title, "body": body}
_notes.append(note)
return note
def get_all_notes() -> List[Dict]:
return _notes