nextcloud connessione ok gdrive no
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Services\StorageRepositoryService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
@@ -112,18 +113,36 @@ class StorageRepositoryController extends Controller
|
||||
$this->authorizeRead('documenti');
|
||||
|
||||
$path = $request->get('path', '/');
|
||||
$contents = $this->repoService->listContents($storageRepository, $path);
|
||||
|
||||
try {
|
||||
if (!$storageRepository->is_active) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Repository non attivo',
|
||||
'contents' => []
|
||||
], 400);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'contents' => $contents,
|
||||
'path' => $path,
|
||||
'repository' => [
|
||||
'id' => $storageRepository->id,
|
||||
'nome' => $storageRepository->nome,
|
||||
'tipo' => $storageRepository->tipo,
|
||||
],
|
||||
]);
|
||||
$contents = $this->repoService->listContents($storageRepository, $path);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'contents' => $contents,
|
||||
'path' => $path,
|
||||
'repository' => [
|
||||
'id' => $storageRepository->id,
|
||||
'nome' => $storageRepository->nome,
|
||||
'tipo' => $storageRepository->tipo,
|
||||
],
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
Log::error("StorageRepository browse failed for repo #{$storageRepository->id}: " . $e->getMessage());
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Errore: ' . $e->getMessage(),
|
||||
'contents' => []
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function reorder(Request $request): JsonResponse
|
||||
|
||||
Reference in New Issue
Block a user