mirror of
https://codeberg.org/diginaut/digimarks.git
synced 2026-02-04 18:30:26 +01:00
Small fixes
This commit is contained in:
@@ -92,7 +92,10 @@ async def list_bookmarks_for_user(
|
|||||||
offset: int = 0,
|
offset: int = 0,
|
||||||
limit: Annotated[int, Query(le=10000)] = 100,
|
limit: Annotated[int, Query(le=10000)] = 100,
|
||||||
) -> Sequence[Bookmark]:
|
) -> Sequence[Bookmark]:
|
||||||
"""List all bookmarks in the database. By default, 100 items are returned."""
|
"""List all bookmarks in the database. By default, 100 items are returned.
|
||||||
|
|
||||||
|
There is a limit of 10000 items.
|
||||||
|
"""
|
||||||
result = await session.exec(
|
result = await session.exec(
|
||||||
select(Bookmark)
|
select(Bookmark)
|
||||||
.where(Bookmark.user_key == user_key, Bookmark.status != Visibility.DELETED)
|
.where(Bookmark.user_key == user_key, Bookmark.status != Visibility.DELETED)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ async def autocomplete_bookmark(
|
|||||||
user_key: str,
|
user_key: str,
|
||||||
bookmark: Bookmark,
|
bookmark: Bookmark,
|
||||||
strip_params: bool = False,
|
strip_params: bool = False,
|
||||||
):
|
) -> Bookmark:
|
||||||
"""Autofill some fields for this (new) bookmark for user `user_key`."""
|
"""Autofill some fields for this (new) bookmark for user `user_key`."""
|
||||||
logger.info('Autocompleting bookmark %s for user %s', bookmark.url_hash, user_key)
|
logger.info('Autocompleting bookmark %s for user %s', bookmark.url_hash, user_key)
|
||||||
return await bookmarks_service.autocomplete_bookmark(session, request, user_key, bookmark, strip_params)
|
return await bookmarks_service.autocomplete_bookmark(session, request, user_key, bookmark, strip_params)
|
||||||
@@ -248,7 +248,7 @@ async def delete_bookmark(
|
|||||||
"""(Soft)Delete bookmark `bookmark_key` for user `user_key`."""
|
"""(Soft)Delete bookmark `bookmark_key` for user `user_key`."""
|
||||||
logger.info('Deleting bookmark %s for user %s', url_hash, user_key)
|
logger.info('Deleting bookmark %s for user %s', url_hash, user_key)
|
||||||
try:
|
try:
|
||||||
result = await bookmarks_service.delete_bookmark(session, user_key, url_hash)
|
_ = await bookmarks_service.delete_bookmark(session, user_key, url_hash)
|
||||||
return {'ok': True}
|
return {'ok': True}
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('Failed to delete bookmark %s', url_hash)
|
logger.exception('Failed to delete bookmark %s', url_hash)
|
||||||
|
|||||||
Reference in New Issue
Block a user