Files
lichterei-web/kirby/config/api/routes/lock.php
Bastian Allgeier 9c89153d35 Upgrade to 3.2.0
2019-06-25 09:56:08 +02:00

53 lines
1.2 KiB
PHP
Executable File

<?php
/**
* Content Lock Routes
*/
return [
[
'pattern' => '(:all)/lock',
'method' => 'GET',
'action' => function (string $path) {
return $this->parent($path)->lock()->get();
}
],
[
'pattern' => '(:all)/lock',
'method' => 'PATCH',
'action' => function (string $path) {
return $this->parent($path)->lock()->create();
}
],
[
'pattern' => '(:all)/lock',
'method' => 'DELETE',
'action' => function (string $path) {
return $this->parent($path)->lock()->remove();
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'GET',
'action' => function (string $path) {
return [
'isUnlocked' => $this->parent($path)->lock()->isUnlocked()
];
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'PATCH',
'action' => function (string $path) {
return $this->parent($path)->lock()->unlock();
}
],
[
'pattern' => '(:all)/unlock',
'method' => 'DELETE',
'action' => function (string $path) {
return $this->parent($path)->lock()->resolve();
}
],
];