fix: service create / update #5

Merged
Sebastian merged 1 commits from fix/service-create-update into main 2026-03-04 03:05:17 +00:00

View File

@@ -177,11 +177,8 @@ class Manager {
throw new InvalidArgumentException("Provider '$providerId' does not support service creation"); throw new InvalidArgumentException("Provider '$providerId' does not support service creation");
} }
// Create a fresh service instance // Create a service instance with provided data
$service = $provider->serviceFresh(); $service = $provider->serviceFresh()->jsonDeserialize($data);
// Deserialize the data into the service
$service->jsonDeserialize($data);
// Create the service // Create the service
$serviceId = $provider->serviceCreate($tenantId, $userId, $service); $serviceId = $provider->serviceCreate($tenantId, $userId, $service);
@@ -218,8 +215,8 @@ class Manager {
throw new InvalidArgumentException("Service '$serviceId' not found"); throw new InvalidArgumentException("Service '$serviceId' not found");
} }
// Update with new data // Create a service instance with updated data
$service->jsonDeserialize($data); $service = $provider->serviceFresh()->jsonDeserialize($data);
// Modify the service // Modify the service
$provider->serviceModify($tenantId, $userId, $service); $provider->serviceModify($tenantId, $userId, $service);