fix: service create / update

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-03-03 22:04:48 -05:00
parent c7d6657254
commit a4967b9c19

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);