mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +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();
|
$bearer = $this->getBearer();
|
||||||
|
|
||||||
$request = new Request('GET', 'appellation');
|
|
||||||
$parameters = [
|
|
||||||
'query' => [
|
|
||||||
'q' => $search,
|
|
||||||
'fq' => 'libelle',
|
|
||||||
],
|
|
||||||
'headers' => [
|
|
||||||
'Authorization' => 'Bearer '.$bearer,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
try {
|
try {
|
||||||
$response = $this->handleRequest(
|
$response = $this->httpClient->request(
|
||||||
$request,
|
'GET', self::BASE . 'appellation/requete', [
|
||||||
$parameters,
|
'headers' => [
|
||||||
$this->client,
|
'Authorization' => 'Bearer '.$bearer,
|
||||||
$this->logger
|
'Accept' => 'application/json',
|
||||||
);
|
],
|
||||||
|
'query' => [
|
||||||
|
'q' => $search
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
return Utils::jsonDecode((string) $response->getBody());
|
return $response->toArray()['resultats'];
|
||||||
} catch (ClientException $e) {
|
} catch (HttpExceptionInterface $exception) {
|
||||||
dump($e->getResponse()->getBody()->getContents());
|
throw $exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response('No appellation found');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAppellation($code)
|
public function getAppellation($code)
|
||||||
|
@ -50,9 +50,6 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
*/
|
*/
|
||||||
protected $validator;
|
protected $validator;
|
||||||
|
|
||||||
/**
|
|
||||||
* RomeAppellationChoiceLoader constructor.
|
|
||||||
*/
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
PartenaireRomeAppellation $apiAppellation,
|
PartenaireRomeAppellation $apiAppellation,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user