@@ -47,20 +47,23 @@ This package contains the [create entity tests](../src/tests/createEntity) and t
47
47
Retreives a sorted paginated array of entities that match the [ ` filter ` ] ( ./options.md#filter ) option.
48
48
49
49
``` ts
50
+ import { backward , forward } from ' js-entity-repos/core/dist/types/PaginationDirection' ;
51
+ import { asc , desc } from ' js-entity-repos/core/dist/types/SortOrder' ;
52
+
50
53
const { entities, nextCursor, previousCursor } = await facade .getEntities ({
51
- filter: { foo: ' bar ' },
52
- sort: { id: true },
53
- pagination: { limit: 10 , forward: true , cursor: undefined },
54
+ filter: { foo: ' demo ' },
55
+ sort: { id: asc , bar: desc },
56
+ pagination: { limit: 10 , direction: forward , cursor: undefined },
54
57
});
55
58
const secondPage = await facade .getEntities ({
56
- filter: { foo: ' bar ' },
57
- sort: { id: true },
58
- pagination: { limit: 10 , forward: true , cursor: nextCursor },
59
+ filter: { foo: ' demo ' },
60
+ sort: { id: asc , bar: desc },
61
+ pagination: { limit: 10 , direction: forward , cursor: nextCursor },
59
62
});
60
63
const firstPage = await facade .getEntities ({
61
- filter: { foo: ' bar ' },
62
- sort: { id: true },
63
- pagination: { limit: 10 , forward: false , cursor: secondPage .previousCursor },
64
+ filter: { foo: ' demo ' },
65
+ sort: { id: asc , bar: desc },
66
+ pagination: { limit: 10 , direction: backward , cursor: secondPage .previousCursor },
64
67
});
65
68
```
66
69
0 commit comments