feat(folders): add curser and the normalized way to get foler's item list. add reverse order

This commit is contained in:
Edouard Vanbelle
2026-05-28 00:44:20 +02:00
parent 1523702ca6
commit 5790a1459f
18 changed files with 1183 additions and 111 deletions
+6 -4
View File
@@ -341,16 +341,18 @@ pub async fn list_shared_with_me(
.into_response();
}
// Decode cursor — discard it when the sort dimension changed to avoid
// keyset confusion across sort modes.
let reverse = q.reverse;
// Decode cursor — discard it when the sort dimension or direction changed
// to avoid keyset confusion across sort modes.
let cursor = q
.decode_cursor::<GrantCursor>()
.filter(|c| c.sort_by == sort_by);
.filter(|c| c.sort_by == sort_by && c.reverse == reverse);
// Fetch paged summaries from the ACL engine.
let (summaries, next_cursor) = match state
.authorization
.list_incoming_resources_paged(subject, &kinds, limit, cursor, sort_by)
.list_incoming_resources_paged(subject, &kinds, limit, cursor, sort_by, reverse)
.await
{
Ok(r) => r,