diff --git a/lib/Controllers/DefaultController.php b/lib/Controllers/DefaultController.php index 869f09b..ef9a9cf 100644 --- a/lib/Controllers/DefaultController.php +++ b/lib/Controllers/DefaultController.php @@ -299,12 +299,16 @@ class DefaultController extends ControllerAbstract { if (!is_array($data['data'])) { throw new InvalidArgumentException(self::ERR_INVALID_DATA); } + if (isset($data['delta']) && !is_bool($data['delta'])) { + throw new InvalidArgumentException('Invalid parameter: delta must be a boolean'); + } return $this->mailManager->serviceUpdate( $tenantId, $userId, $data['provider'], $data['identifier'], + $data['delta'] ?? false, $data['data'] ); } diff --git a/lib/Manager.php b/lib/Manager.php index acd768b..97de2c4 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -247,17 +247,18 @@ class Manager { * @param string $userId User identifier for context * @param string $providerId Provider identifier * @param string|int $serviceId Service identifier + * @param bool $delta Whether the update is a delta (partial) update or a full replacement * @param array $data Updated service configuration data * * @return ServiceBaseInterface Updated service * * @throws InvalidArgumentException If provider doesn't support service modification or service not found */ - public function serviceUpdate(string $tenantId, string $userId, string $providerId, string|int $serviceId, array $data): ServiceBaseInterface { + public function serviceUpdate(string $tenantId, string $userId, string $providerId, string|int $serviceId, bool $delta = false, array $data): ServiceBaseInterface { // retrieve provider and service $provider = $this->providerFetch($tenantId, $userId, $providerId); if ($provider instanceof ProviderServiceMutateInterface === false) { - throw new InvalidArgumentException("Provider '$providerId' does not support service creation"); + throw new InvalidArgumentException("Provider '$providerId' does not support service modification"); } // Fetch existing service @@ -267,7 +268,7 @@ class Manager { } // Update with new data - $service->jsonDeserialize($data); + $service->jsonDeserialize($data, $delta); // Modify the service $provider->serviceModify($tenantId, $userId, $service); @@ -294,7 +295,7 @@ class Manager { // retrieve provider and service $provider = $this->providerFetch($tenantId, $userId, $providerId); if ($provider instanceof ProviderServiceMutateInterface === false) { - throw new InvalidArgumentException("Provider '$providerId' does not support service creation"); + throw new InvalidArgumentException("Provider '$providerId' does not support service deletion"); } // Fetch existing service diff --git a/src/components/AddAccountDialog.vue b/src/components/AddAccountDialog.vue index 2f129aa..0f62246 100644 --- a/src/components/AddAccountDialog.vue +++ b/src/components/AddAccountDialog.vue @@ -1,5 +1,5 @@ + + \ No newline at end of file diff --git a/src/components/steps/ProviderProtocolPanel.vue b/src/components/steps/ProviderProtocolPanel.vue index f3f8396..4e41553 100644 --- a/src/components/steps/ProviderProtocolPanel.vue +++ b/src/components/steps/ProviderProtocolPanel.vue @@ -66,11 +66,11 @@ async function loadProviderPanel() { panelLoading.value = true // retrieve panel from integration store - const panel = integrationStore.getItems('mail_account_protocol_panels').find((panel: any) => { + const panel = integrationStore.getItems('mail_provider_panels_protocol').find((panel: any) => { return panel.id === providerIdentifier || panel.id.endsWith(`.${providerIdentifier}`) }) if (!panel?.component) { - console.warn(`No config panel found for provider ID: ${providerIdentifier}`) + console.warn(`No panel found for provider ID: ${providerIdentifier}`) panelActive.value = null panelLoading.value = false return @@ -97,21 +97,20 @@ function handleUpdate(service: ServiceObject) {