Skip to content

Commit

Permalink
rest route getItemFunc bei mehrenen Instanzen ergänzt
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Nov 1, 2023
1 parent 4162d18 commit f6b9e4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/rest/lib/rest/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,15 @@ public function handleRequest(array $paths, array $get)
$data = [];
if ($instances) {
foreach ($instances as $instance) {
$data[] = $this->getInstanceData(
$instance_data = $this->getInstanceData(
$instance,
array_merge($paths, [$instance->getId()])
);
if (is_callable($this->getItemFunc)) {
$instance_data = call_user_func($this->getItemFunc, $this, $instance_data);
}

$data[] = $instance_data;
}
if ($baseInstances) {
$links = [];
Expand Down

0 comments on commit f6b9e4a

Please sign in to comment.