Skip to content

Commit 1a3b3a0

Browse files
committed
🚀 ready for lift-off
1 parent 27b99e6 commit 1a3b3a0

File tree

4 files changed

+198
-63
lines changed

4 files changed

+198
-63
lines changed

classes/APIRecords.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ public function toArray(): array
100100
$map = $this->recordsDataMap;
101101
$data = $this->fetch();
102102

103+
if (empty($data)) {
104+
return [];
105+
}
106+
103107
// handle the data like Kirby's OptionApi does to allow for the entry query with sorting etc.
104108
$data = Nest::create($data);
105109
$result = Query::factory($this->recordsDataQuery)->resolve($data);

composer.lock

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
'options' => [
1010
'cache' => true,
1111
'expire' => 60, // in minutes
12+
// copy this to your config as bnomei.api-pages.exception
1213
'exception' => function (\Kirby\Http\Remote $remote) {
13-
throw new \Exception($remote->url().' => '.$remote->code());
14+
// throw new \Exception($remote->url().' => '.$remote->code());
1415
},
1516
'records' => [
1617
// register custom record configs as an alternative to the blueprint

0 commit comments

Comments
 (0)