diff --git a/src/app/external/exportSeda/controllers/SedaController.php b/src/app/external/exportSeda/controllers/SedaController.php index 188a3b6bfdab74d56050d367f2564979b7189924..4222b27550f0c57ca31bed6103fb8ba65c7c33a4 100755 --- a/src/app/external/exportSeda/controllers/SedaController.php +++ b/src/app/external/exportSeda/controllers/SedaController.php @@ -449,7 +449,13 @@ class SedaController return ['errors' => 'Error returned by the route /organization/organization/Search : ' . $curlResponse['response']['message']]; } - return ['producerServiceInfo' => $curlResponse['response'][0]]; + foreach ($curlResponse['response'] as $organization) { + if ($organization['registrationNumber'] == $args['producerServiceName']) { + return ['producerServiceInfo' => $organization]; + } + } + + return ['producerServiceInfo' => null]; } public function getRetentionRules(Request $request, Response $response)