Update Composer packages
This commit is contained in:
parent
d482354bdf
commit
e7e7361480
219 changed files with 6487 additions and 4444 deletions
|
@ -38,14 +38,17 @@ return [
|
|||
// move_uploaded_file() not working with unit test
|
||||
// @codeCoverageIgnoreStart
|
||||
return $this->upload(function ($source, $filename) use ($path) {
|
||||
return $this->parent($path)->createFile([
|
||||
$props = [
|
||||
'content' => [
|
||||
'sort' => $this->requestBody('sort')
|
||||
],
|
||||
'source' => $source,
|
||||
'template' => $this->requestBody('template'),
|
||||
'filename' => $filename
|
||||
]);
|
||||
];
|
||||
|
||||
// move the source file from the temp dir
|
||||
return $this->parent($path)->createFile($props, true);
|
||||
});
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
@ -95,8 +98,9 @@ return [
|
|||
'pattern' => $pattern . '/files/(:any)',
|
||||
'method' => 'POST',
|
||||
'action' => function (string $path, string $filename) {
|
||||
// move the source file from the temp dir
|
||||
return $this->upload(
|
||||
fn ($source) => $this->file($path, $filename)->replace($source)
|
||||
fn ($source) => $this->file($path, $filename)->replace($source, true)
|
||||
);
|
||||
}
|
||||
],
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
/**
|
||||
* Content Lock Routes
|
||||
*/
|
||||
|
||||
use Kirby\Exception\NotFoundException;
|
||||
|
||||
return [
|
||||
[
|
||||
'pattern' => '(:all)/lock',
|
||||
|
@ -25,7 +28,11 @@ return [
|
|||
'pattern' => '(:all)/lock',
|
||||
'method' => 'DELETE',
|
||||
'action' => function (string $path) {
|
||||
return $this->parent($path)->lock()?->remove();
|
||||
try {
|
||||
return $this->parent($path)->lock()?->remove();
|
||||
} catch (NotFoundException) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
|
@ -39,7 +46,11 @@ return [
|
|||
'pattern' => '(:all)/unlock',
|
||||
'method' => 'DELETE',
|
||||
'action' => function (string $path) {
|
||||
return $this->parent($path)->lock()?->resolve();
|
||||
try {
|
||||
return $this->parent($path)->lock()?->resolve();
|
||||
} catch (NotFoundException) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
],
|
||||
];
|
||||
|
|
|
@ -82,11 +82,16 @@ return [
|
|||
$this->user($id)->avatar()?->delete();
|
||||
|
||||
return $this->upload(
|
||||
fn ($source, $filename) => $this->user($id)->createFile([
|
||||
'filename' => 'profile.' . F::extension($filename),
|
||||
'template' => 'avatar',
|
||||
'source' => $source
|
||||
]),
|
||||
function ($source, $filename) use ($id) {
|
||||
$props = [
|
||||
'filename' => 'profile.' . F::extension($filename),
|
||||
'template' => 'avatar',
|
||||
'source' => $source
|
||||
];
|
||||
|
||||
// move the source file from the temp dir
|
||||
return $this->user($id)->createFile($props, true);
|
||||
},
|
||||
single: true
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue