feat: use resource identifier
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user