Code-Schnipsel: Diff-History, Beschreibung sichtbar, Multi-Tag-Filter, Geteilt-von-mir Tab, nur genutzte Tags

This commit is contained in:
2026-05-29 13:45:33 +02:00
parent fa1562bdce
commit 82fcfd07c5
2 changed files with 137 additions and 60 deletions

View File

@@ -27,7 +27,16 @@ router.get('/', authenticate, (req, res) => {
ORDER BY s.updated_at DESC
`).all(me).map(enrich);
res.json({ own, shared });
const sharedByMe = db.prepare(`
SELECT s.*, u.username as shared_with_name
FROM snippets s
JOIN snippet_shares sh ON sh.snippet_id=s.id
JOIN users u ON u.id=sh.shared_with
WHERE s.user_id=?
ORDER BY s.title ASC
`).all(me).map(enrich);
res.json({ own, shared, sharedByMe });
});
// ── Einzelnes Snippet ────────────────────────────────────────────────────────