feat: use resource identifier

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-05 20:10:08 -04:00
parent 41de70da75
commit 26ed0c8aad
2 changed files with 24 additions and 17 deletions
+6 -5
View File
@@ -62,14 +62,14 @@ class TransferController extends ControllerAbstract
/** @var EntityBaseInterface[] $entities */
$entities = $this->manager->entityFetchBulk($tenantId, $userId, $target);
if (empty($entities) || !isset($entities[$identifier])) {
if (!isset($entities[(string) $target])) {
return new JsonResponse([
'status' => 'error',
'error' => ['code' => 404, 'message' => 'File not found']
], Response::HTTP_NOT_FOUND);
}
$entity = $entities[$identifier];
$entity = $entities[(string) $target];
// Get the stream
$stream = $this->manager->entityReadStream($tenantId, $userId, $target);
@@ -327,15 +327,16 @@ class TransferController extends ControllerAbstract
foreach ($ids as $id) {
// Try as entity first
if ($collection !== null) {
$target = new EntityIdentifier($provider, $service, $collection, (string) $id);
/** @var EntityBaseInterface[] $entities */
$entities = $this->manager->entityFetchBulk(
$tenantId,
$userId,
new EntityIdentifier($provider, $service, $collection, (string)$id)
$target
);
if (!empty($entities) && isset($entities[$id])) {
$entity = $entities[$id];
if (isset($entities[(string) $target])) {
$entity = $entities[(string) $target];
$files[] = [
'type' => 'file',
'id' => $id,