feat: collection move
Some checks failed
JS Unit Tests / test (pull_request) Failing after 26s
Build Test / test (pull_request) Successful in 32s
PHP Unit Tests / test (pull_request) Successful in 53s

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-05-06 12:03:05 -04:00
parent 9b6823c481
commit fbc8ac2d7e
5 changed files with 117 additions and 11 deletions

View File

@@ -152,7 +152,7 @@ class DefaultController extends ControllerAbstract {
'collection.update' => $this->collectionUpdate($tenantId, $userId, $data),
'collection.delete' => $this->collectionDelete($tenantId, $userId, $data),
'collection.delta' => throw new InvalidArgumentException('Operation not implemented: ' . $operation),
'collection.move' => throw new InvalidArgumentException('Operation not implemented: ' . $operation),
'collection.move' => $this->collectionMove($tenantId, $userId, $data),
// Entity operations
'entity.list' => $this->entityList($tenantId, $userId, $data),
@@ -581,11 +581,11 @@ class DefaultController extends ControllerAbstract {
if (!is_string($data['target'])) {
throw new InvalidArgumentException(self::ERR_INVALID_TARGET);
}
if (!isset($data['sources'])) {
throw new InvalidArgumentException(self::ERR_MISSING_SOURCES);
if (!isset($data['source'])) {
throw new InvalidArgumentException(self::ERR_MISSING_SOURCE);
}
if (!is_array($data['sources'])) {
throw new InvalidArgumentException(self::ERR_INVALID_SOURCES);
if (!is_string($data['source'])) {
throw new InvalidArgumentException(self::ERR_INVALID_SOURCE);
}
$target = ResourceIdentifier::fromString($data['target']);
@@ -593,9 +593,10 @@ class DefaultController extends ControllerAbstract {
throw new InvalidArgumentException('Invalid parameter: target must be provider:service:collection');
}
$source = ResourceIdentifier::fromArray($data['source']);
$source = ResourceIdentifier::fromString($data['source']);
if (!$source instanceof CollectionIdentifier) {
throw new InvalidArgumentException('Invalid parameter: sources must contain provider:service:collection identifiers');
throw new InvalidArgumentException('Invalid parameter: source must be provider:service:collection');
}
return $this->mailManager->collectionMove($tenantId, $userId, $target, $source);