From d7c9de2bd61d39fb277916d9fda5522054171c18 Mon Sep 17 00:00:00 2001 From: F4ilji Date: Sat, 4 Jul 2026 21:55:29 +0500 Subject: [PATCH] fix(vikon): restore syncDirFiles subdirs - files go to files/{dirId}/ --- .../VikonIntegration/Actions/UpdateCoreAction.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php b/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php index 9fa8cf2..1334721 100644 --- a/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php +++ b/app/Containers/VikonIntegration/Actions/UpdateCoreAction.php @@ -99,17 +99,21 @@ class UpdateCoreAction $accessToken, 'filemanager' ); + $targetDir = $filesDir; } else { $response = $this->http->getWithToken( "sync/getFileNamesFromSubDirectoryByModule?dir={$dirId}&moduleId={$moduleId}", $accessToken, 'filemanager' ); + $targetDir = $filesDir . '/' . $dirId; } $files = $response->json()['files'] ?? []; if (empty($files)) return 0; + File::makeDirectory($targetDir, 0755, true, true); + $synced = 0; foreach ($files as $file) { $name = $file['n'] ?? null; @@ -122,7 +126,7 @@ class UpdateCoreAction $accessToken, 'filemanager' ); - file_put_contents($filesDir . '/' . $name, $content); + file_put_contents($targetDir . '/' . $name, $content); $synced++; } catch (\Throwable $e) { Log::warning('Vikon FM: download failed', ['identity' => $identity, 'error' => $e->getMessage()]);