|
@@ -711,18 +711,17 @@ class DolibarrSyncService
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Post-validation of the execution of the operation.
|
|
* Post-validation of the execution of the operation.
|
|
|
|
|
+ * Compare the actual result to the expected one to ensure that the data was correctly updated.
|
|
|
|
|
+ *
|
|
|
* In the case of a validation error, throw an HttpException
|
|
* In the case of a validation error, throw an HttpException
|
|
|
*
|
|
*
|
|
|
* @param ResponseInterface $response
|
|
* @param ResponseInterface $response
|
|
|
* @param BaseRestOperation $operation
|
|
* @param BaseRestOperation $operation
|
|
|
* @throws RuntimeException
|
|
* @throws RuntimeException
|
|
|
*/
|
|
*/
|
|
|
- protected function validateResponse(ResponseInterface $response, BaseRestOperation $operation): void
|
|
|
|
|
|
|
+ protected function validateResponse(ResponseInterface $response, UpdateOperation | CreateOperation $operation): void
|
|
|
{
|
|
{
|
|
|
$updated = $operation->getData();
|
|
$updated = $operation->getData();
|
|
|
- if ($updated === null) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
$responseData = $response->toArray();
|
|
$responseData = $response->toArray();
|