refactor: split buspro ApiClient into domain clients
This commit is contained in:
1 parent
0a55544ca8
commit
b755a6f43e
52 files changed
+805
-695
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Client\AccountClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\Entity\User;
|
||||
@@ -17,7 +17,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
#[IsGranted('ROLE_OAUTH2_PROFILE')]
|
||||
class CrmAttributeController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly ApiClient $apiClient, private readonly Crypt $crypt)
|
||||
public function __construct(private readonly AccountClient $accountClient, private readonly Crypt $crypt)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class CrmAttributeController extends AbstractController
|
||||
$password = $this->crypt->decrypt($user->getPassword());
|
||||
|
||||
try {
|
||||
$data = $this->apiClient->getCrmAttributes($email, $password);
|
||||
$data = $this->accountClient->getCrmAttributes($email, $password);
|
||||
|
||||
if ($data instanceof Notification) {
|
||||
return new JsonResponse(['message' => $data->message, 'code' => $data->code], Response::HTTP_BAD_REQUEST);
|
||||
|
||||
Reference in new issue
Block a user