downgrade to kirby v3
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Site Routes
|
||||
*/
|
||||
return [
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
[
|
||||
'pattern' => 'site',
|
||||
'action' => function () {
|
||||
@@ -75,35 +75,30 @@ return [
|
||||
$pages = $this
|
||||
->site()
|
||||
->index(true)
|
||||
->filter('isListable', true);
|
||||
->filter('isReadable', true);
|
||||
|
||||
if ($this->requestMethod() === 'GET') {
|
||||
return $pages->search($this->requestQuery('q'));
|
||||
} else {
|
||||
return $pages->query($this->requestBody());
|
||||
}
|
||||
|
||||
return $pages->query($this->requestBody());
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => 'site/fields/(:any)/(:all?)',
|
||||
'method' => 'ALL',
|
||||
'action' => function (string $fieldName, string|null $path = null) {
|
||||
return $this->fieldApi($this->site(), $fieldName, $path);
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => 'site/sections/(:any)',
|
||||
'method' => 'GET',
|
||||
'action' => function (string $sectionName) {
|
||||
return $this->site()->blueprint()->section($sectionName)?->toResponse();
|
||||
if ($section = $this->site()->blueprint()->section($sectionName)) {
|
||||
return $section->toResponse();
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
'pattern' => 'site/sections/(:any)/(:all?)',
|
||||
'pattern' => 'site/fields/(:any)/(:all?)',
|
||||
'method' => 'ALL',
|
||||
'action' => function (string $sectionName, string|null $path = null) {
|
||||
return $this->sectionApi($this->site(), $sectionName, $path);
|
||||
'action' => function (string $fieldName, string $path = null) {
|
||||
return $this->fieldApi($this->site(), $fieldName, $path);
|
||||
}
|
||||
],
|
||||
// @codeCoverageIgnoreEnd
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user