- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites) - Remove localhost refs: openapi, inbox page - Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI - Add stub routes: knowledge/insights, recommendations, search, log-error - Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests - Fix inbox-server: ORDER BY created_at, package.json - Remove redundant app/api/inbox/files route (rewrites handle it) - knowledge/ in gitignore (large PDFs) Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
319 B
Python
12 lines
319 B
Python
from sqlalchemy.orm import Session
|
|
|
|
from app.models import Notification
|
|
|
|
|
|
def notify(db: Session, recipient_user_id: str, title: str, body: str | None = None) -> Notification:
|
|
n = Notification(recipient_user_id=recipient_user_id, title=title, body=body)
|
|
db.add(n)
|
|
db.commit()
|
|
db.refresh(n)
|
|
return n
|