resolve conflict
This commit is contained in:
parent
06d3a71fb0
commit
d465fb3de7
6 changed files with 134 additions and 36 deletions
|
|
@ -1,12 +1,12 @@
|
|||
Date: 2024-10-02 02:10
|
||||
|
||||
----
|
||||
|
||||
Description:
|
||||
|
||||
----
|
||||
|
||||
Tags:
|
||||
Tags: bouton poussoir, coloris & nuances
|
||||
|
||||
----
|
||||
|
||||
Date: 2024-10-02 02:10
|
||||
|
||||
----
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ return [
|
|||
require(__DIR__ . '/routes/toggle-favorite.php'),
|
||||
require(__DIR__ . '/routes/upload-images.php'),
|
||||
require(__DIR__ . '/routes/save-page.php'),
|
||||
require(__DIR__ . '/routes/save-file.php'),
|
||||
],
|
||||
'hooks' => [
|
||||
'page.create:after' => require_once(__DIR__ . '/hooks/create-steps.php'),
|
||||
|
|
|
|||
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);
|
||||
}
|
||||
];
|
||||
|
|
@ -6,8 +6,8 @@ foreach ($page->clientBriefImages()->toFiles() as $image) {
|
|||
$images[] = [
|
||||
'url' => $image->url(),
|
||||
'uuid' => (string) $image->uuid(),
|
||||
'tags' => page('projects')->clientBriefImageTags()->split(),
|
||||
'selectedTags' => $image->tags()->split()
|
||||
'tags' => $image->tags()->split(),
|
||||
'name' => $image->filename()
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue