feat: collection move
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user