resolve conflict
This commit is contained in:
parent
06d3a71fb0
commit
d465fb3de7
6 changed files with 134 additions and 36 deletions
25
public/site/config/routes/save-file.php
Normal file
25
public/site/config/routes/save-file.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'pattern' => '(:all)save-file.json',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
$page = page($data->pageUri);
|
||||
$file = $page->file($data->fileName);
|
||||
|
||||
|
||||
|
||||
$newProperties = [];
|
||||
|
||||
foreach ($data->properties as $incomingProperty) {
|
||||
$newProperties[$incomingProperty->name] = $incomingProperty->value;
|
||||
}
|
||||
|
||||
$newFile = $file->update($newProperties);
|
||||
|
||||
return json_encode($newProperties);
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue