feat: geräte-tokens im konto, neuester clip für kurzbefehle
Token-Verwaltung unter "Konto" (einmalige Anzeige, letzte Nutzung, Widerruf), GET /api/clips/latest für iPhone-Kurzbefehle und Skripte, README mit Anleitung für die Kurzbefehle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d8377c8a04
commit
223eb4eb45
10 files changed
+505
-1
No files matched your search
@@ -59,6 +59,16 @@ def create_clip(body: ClipCreate, user: ApiUser, db: DbSession, background: Back
|
||||
return clip
|
||||
|
||||
|
||||
# Before /{clip_id}, which would otherwise answer "latest" with 422
|
||||
@router.get("/latest", response_model=ClipOut)
|
||||
def latest_clip(user: ApiUser, db: DbSession):
|
||||
"""For scripts such as the iPhone shortcut: newest text/code clip, pinned or not."""
|
||||
clip = clip_service.latest_text_clip(db, user.id)
|
||||
if clip is None:
|
||||
raise HTTPException(status.HTTP_404_NOT_FOUND, "Noch keine Clips.")
|
||||
return clip
|
||||
|
||||
|
||||
@router.get("/{clip_id}", response_model=ClipOut)
|
||||
def get_clip(clip_id: int, user: ApiUser, db: DbSession):
|
||||
return _get_visible_clip(db, user, clip_id)
|
||||
|
||||
Reference in new issue
Block a user