Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 7049833

Browse files
authored
docs(functions): Corrects getEntities docs.
1 parent b4a41f1 commit 7049833

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/functions.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,23 @@ This package contains the [create entity tests](../src/tests/createEntity) and t
4747
Retreives a sorted paginated array of entities that match the [`filter`](./options.md#filter) option.
4848

4949
```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+
5053
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 },
5457
});
5558
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 },
5962
});
6063
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 },
6467
});
6568
```
6669

0 commit comments

Comments
 (0)