mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix the appellation selection for projet professional
This commit is contained in:
parent
33a6f9996e
commit
a5c2576124
@ -65,30 +65,23 @@ class PartenaireRomeAppellation
|
||||
{
|
||||
$bearer = $this->getBearer();
|
||||
|
||||
$request = new Request('GET', 'appellation');
|
||||
$parameters = [
|
||||
'query' => [
|
||||
'q' => $search,
|
||||
'fq' => 'libelle',
|
||||
],
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '.$bearer,
|
||||
],
|
||||
];
|
||||
try {
|
||||
$response = $this->handleRequest(
|
||||
$request,
|
||||
$parameters,
|
||||
$this->client,
|
||||
$this->logger
|
||||
);
|
||||
$response = $this->httpClient->request(
|
||||
'GET', self::BASE . 'appellation/requete', [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '.$bearer,
|
||||
'Accept' => 'application/json',
|
||||
],
|
||||
'query' => [
|
||||
'q' => $search
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
return Utils::jsonDecode((string) $response->getBody());
|
||||
} catch (ClientException $e) {
|
||||
dump($e->getResponse()->getBody()->getContents());
|
||||
return $response->toArray()['resultats'];
|
||||
} catch (HttpExceptionInterface $exception) {
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
return new Response('No appellation found');
|
||||
}
|
||||
|
||||
public function getAppellation($code)
|
||||
|
@ -50,9 +50,6 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
*/
|
||||
protected $validator;
|
||||
|
||||
/**
|
||||
* RomeAppellationChoiceLoader constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
PartenaireRomeAppellation $apiAppellation,
|
||||
|
Loading…
x
Reference in New Issue
Block a user