Merge pull request 'fix: testing fixes' (#22) from fix/testing-fixes into main
Some checks failed
Renovate / renovate (push) Failing after 1m35s
Some checks failed
Renovate / renovate (push) Failing after 1m35s
Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
@@ -608,13 +608,11 @@ class Manager {
|
|||||||
throw new InvalidArgumentException("Service '{$service->identifier()}' is not capable of creating collections");
|
throw new InvalidArgumentException("Service '{$service->identifier()}' is not capable of creating collections");
|
||||||
}
|
}
|
||||||
// convert properties if necessary
|
// convert properties if necessary
|
||||||
if (is_array($properties)) {
|
if ($properties instanceof CollectionPropertiesMutableInterface === false) {
|
||||||
$collection = $service->collectionFresh()->getProperties()->jsonDeserialize($properties);
|
$properties = $service->collectionFresh()->getProperties()->jsonDeserialize($properties);
|
||||||
} else {
|
|
||||||
$collection = $properties;
|
|
||||||
}
|
}
|
||||||
// Create collection
|
// Create collection
|
||||||
return $service->collectionCreate($target, $collection, $options);
|
return $service->collectionCreate($target, $properties, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -642,13 +640,11 @@ class Manager {
|
|||||||
throw new InvalidArgumentException("Service '{$service->identifier()}' is not capable of updating collections");
|
throw new InvalidArgumentException("Service '{$service->identifier()}' is not capable of updating collections");
|
||||||
}
|
}
|
||||||
// convert properties if necessary
|
// convert properties if necessary
|
||||||
if (is_array($properties)) {
|
if ($properties instanceof CollectionPropertiesMutableInterface === false) {
|
||||||
$mutation = $service->collectionFresh()->getProperties()->jsonDeserialize($properties);
|
$properties = $service->collectionFresh()->getProperties()->jsonDeserialize($properties);
|
||||||
} else {
|
|
||||||
$mutation = $properties;
|
|
||||||
}
|
}
|
||||||
// Update collection
|
// Update collection
|
||||||
return $service->collectionUpdate($target, $mutation);
|
return $service->collectionUpdate($target, $properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -296,9 +296,10 @@ export const useCollectionsStore = defineStore('mailCollectionsStore', () => {
|
|||||||
properties: properties.toJson()
|
properties: properties.toJson()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Merge created collection into state
|
if (response instanceof CollectionObject) {
|
||||||
_collections.value[response.identifier] = response
|
_collections.value[response.identifier] = response
|
||||||
indexCollection(response)
|
indexCollection(response)
|
||||||
|
}
|
||||||
|
|
||||||
console.debug('[Mail Manager][Store] - Successfully created collection:', response.identifier)
|
console.debug('[Mail Manager][Store] - Successfully created collection:', response.identifier)
|
||||||
return response
|
return response
|
||||||
@@ -326,12 +327,14 @@ export const useCollectionsStore = defineStore('mailCollectionsStore', () => {
|
|||||||
properties: properties.toJson()
|
properties: properties.toJson()
|
||||||
})
|
})
|
||||||
|
|
||||||
if (_collections.value[response.identifier]) {
|
if (_collections.value[target]) {
|
||||||
deindexCollection(_collections.value[response.identifier])
|
deindexCollection(_collections.value[target])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response instanceof CollectionObject) {
|
||||||
_collections.value[response.identifier] = response
|
_collections.value[response.identifier] = response
|
||||||
indexCollection(response)
|
indexCollection(response)
|
||||||
|
}
|
||||||
|
|
||||||
console.debug('[Mail Manager][Store] - Successfully updated collection:', response.identifier)
|
console.debug('[Mail Manager][Store] - Successfully updated collection:', response.identifier)
|
||||||
return response
|
return response
|
||||||
|
|||||||
Reference in New Issue
Block a user