bookmarks function

  1. @riverpod
Future<List<Bookmark>> bookmarks(
  1. Ref<Object?> ref, {
  2. BookmarkKind? filter,
})

All bookmarks for the current user, newest first. Pass filter to scope to one BookmarkKind.

Backed by user_bookmarks (migration 063). RLS scopes the query to the authenticated user — no extra filter needed.

Implementation

@riverpod
Future<List<Bookmark>> bookmarks(Ref ref, {BookmarkKind? filter}) async {
  final ds = ref.watch(supabaseDatasourceProvider);
  final models = await ds.getBookmarks(filter: filter);
  return models.map((m) => m.toEntity()).toList();
}