handle bookmark delete loading state

This commit is contained in:
2025-05-07 16:57:09 +01:00
parent e87a6586b6
commit 9f00c9bb29
7 changed files with 107 additions and 31 deletions

View File

@@ -18,7 +18,13 @@ async function listUserBookmarks(request: Bun.BunRequest<"/api/bookmarks">, user
}
const listBookmarksQuery = db.query(
"SELECT id, kind, title, url FROM bookmarks WHERE user_id = $userId ORDER BY id LIMIT $limit OFFSET $skip",
`
SELECT bookmarks.id, bookmarks.kind, bookmarks.title, bookmarks.url, tags.name as tag FROM bookmarks
LEFT JOIN tags
ON bookmarks.id = tags.bookmark_id
WHERE bookmarks.user_id = $userId
ORDER BY bookmarks.id LIMIT $limit OFFSET $skip
`,
)
const results = listBookmarksQuery.all({