resolve conflict

This commit is contained in:
isUnknown 2024-10-08 17:31:18 +02:00
parent 06d3a71fb0
commit d465fb3de7
6 changed files with 134 additions and 36 deletions

View 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);
}
];