Skip to content

Commit

Permalink
Merge pull request #2 from jeyroik/v0
Browse files Browse the repository at this point in the history
added default sort key
  • Loading branch information
jeyroik committed Sep 30, 2020
2 parents 76ee3e7 + 55507ab commit 65aaed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion extas.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"subject": "extas.jsonrpc.request",
"methods": [
"getLimit", "getOffset", "getSelect", "getSort"
]
],
"install_on": "install"
}
]
}
5 changes: 3 additions & 2 deletions src/components/operations/jsonrpc/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public function run(): array
* @var IExtensionJsonRpcIndex|IRequest $request
*/
$request = $this->getJsonRpcRequest();
$records = $this->getOperation()->getItemRepository()->all(
$repository = $this->getOperation()->getItemRepository();
$records = $repository->all(
[],
$request->getLimit(0),
$request->getOffset(0),
$this->convertIntoTableSort($request->getSort([]))
$this->convertIntoTableSort($request->getSort([$repository->getPk()]))
);

$items = $this->filter($request->getFilter(), $records);
Expand Down

0 comments on commit 65aaed5

Please sign in to comment.