Social: Vorschläge merken (📌), Post-Link nachträglich eintragen, Quick-Post ohne prompt(), SW by-v369

This commit is contained in:
rene 2026-04-25 10:23:17 +02:00
parent 092230c4e1
commit e2bb1a4b2d
3 changed files with 130 additions and 16 deletions

View file

@ -1052,6 +1052,27 @@ async def get_suggestions(user=Depends(require_social_media)):
# ------------------------------------------------------------------
# POST /api/social/ideas/save — Vorschlag als Idee speichern (zurückstellen)
# ------------------------------------------------------------------
@router.post("/ideas/save", status_code=201)
async def save_idea(data: dict, user=Depends(require_social_media)):
"""Speichert einen KI-Vorschlag als Idee in der DB (status='idea')."""
topic = (data.get("topic") or data.get("thema") or "").strip()
platform = data.get("platform", "both")
fmt = data.get("format", "post")
category = data.get("category")
if not topic:
raise HTTPException(400, "topic fehlt.")
with db() as conn:
cur = conn.execute(
"""INSERT INTO social_content
(created_by, platform, format, topic, status, category, source)
VALUES (?,?,?,?,'idea',?,'saved_suggestion')""",
(user["id"], platform, fmt, topic, category),
)
return {"id": cur.lastrowid, "topic": topic, "status": "idea"}
# GET /api/social/content — alle Einträge
# ------------------------------------------------------------------
@router.get("/content")