file upload from bank working
This commit is contained in:
parent
53ca51c154
commit
4f808ba017
5 changed files with 34 additions and 11 deletions
|
|
@ -1,8 +1,8 @@
|
|||
Description: test
|
||||
Description:
|
||||
|
||||
----
|
||||
|
||||
Tags: bouton poussoir
|
||||
Tags:
|
||||
|
||||
----
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
|
|
@ -0,0 +1,17 @@
|
|||
Description: test
|
||||
|
||||
----
|
||||
|
||||
Tags: DA globale
|
||||
|
||||
----
|
||||
|
||||
Sort: 7
|
||||
|
||||
----
|
||||
|
||||
Uuid: cWXe3yDs2zcLLiQE
|
||||
|
||||
----
|
||||
|
||||
Template: image
|
||||
|
|
@ -14,7 +14,7 @@ Description:
|
|||
|
||||
----
|
||||
|
||||
Clientbriefimages:
|
||||
Clientbriefimages: - file://cWXe3yDs2zcLLiQE
|
||||
|
||||
----
|
||||
|
||||
|
|
|
|||
|
|
@ -28,16 +28,16 @@ return [
|
|||
if (!empty($data['imageUris'])) {
|
||||
foreach ($data['imageUris'] as $imageUri) {
|
||||
$imageData = json_decode($imageUri, true);
|
||||
|
||||
|
||||
$source = page('materials')->file($imageData['uuid']);
|
||||
try {
|
||||
$copiedFile = $source->copy($page);
|
||||
$updatedFile = $source->update([
|
||||
$updatedFile = $copiedFile->update([
|
||||
'description' => $imageData['description'],
|
||||
'tags' => $imageData['tags'],
|
||||
]);
|
||||
|
||||
$allFiles[] = (string) $updatedFile->uuid();
|
||||
$allFiles[] = (string) $copiedFile->uuid();
|
||||
} catch (Exception $e) {
|
||||
$alerts[$source->name()] = $e->getMessage();
|
||||
}
|
||||
|
|
@ -97,15 +97,21 @@ return [
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!empty($allFiles)) {
|
||||
// Empty page update needed to updates its files data
|
||||
$newPage = $page->update([]);
|
||||
|
||||
$newPage = $page->update([
|
||||
'clientBriefImages' => $allFiles
|
||||
]);
|
||||
}
|
||||
|
||||
throw new Exception(json_encode($allFiles), 1);
|
||||
|
||||
|
||||
$page = $page->update([
|
||||
'clientBriefImages' => $allFiles
|
||||
]);
|
||||
|
||||
$images = [];
|
||||
// foreach ($page->clientBriefImages()->toFiles() as $image) {
|
||||
// foreach ($newPage->clientBriefImages()->toFiles() as $image) {
|
||||
// $images[] = [
|
||||
// 'url' => $image->url(),
|
||||
// 'uuid' => (string) $image->uuid(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue