Change APIResponse namespace for CAPI controllers. #749
This commit is contained in:
parent
11355f3eb2
commit
976acc26ad
9 changed files with 13 additions and 11 deletions
|
|
@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\SAPBattery;
|
use App\Entity\SAPBattery;
|
||||||
use App\Entity\SAPBatterySize;
|
use App\Entity\SAPBatterySize;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
//use Catalyst\ApiBundle\Response\APIResponse;
|
|
||||||
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\Customer;
|
use App\Entity\Customer;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||||
|
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Service\RisingTideGateway;
|
use App\Service\RisingTideGateway;
|
||||||
use App\Service\WarrantyAPILogger;
|
use App\Service\WarrantyAPILogger;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\Dealer;
|
use App\Entity\Dealer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\Municipality;
|
use App\Entity\Municipality;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\PrivacyPolicy;
|
use App\Entity\PrivacyPolicy;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
use App\Entity\Vehicle;
|
use App\Entity\Vehicle;
|
||||||
use App\Entity\VehicleManufacturer;
|
use App\Entity\VehicleManufacturer;
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ class VehicleController extends ApiController
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('vehicle.list', null, 'No access.');
|
$this->denyAccessUnlessGranted('vehicle.list', null, 'No access.');
|
||||||
|
|
||||||
$mfg = $this->em->getRepository(VehicleManufacturer::class)->find($mfg_id);
|
$mfg = $em->getRepository(VehicleManufacturer::class)->find($mfg_id);
|
||||||
|
|
||||||
// manufacturer not found
|
// manufacturer not found
|
||||||
if ($mfg == null)
|
if ($mfg == null)
|
||||||
|
|
@ -69,6 +69,9 @@ class VehicleController extends ApiController
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: need to add manufacturer details
|
// TODO: need to add manufacturer details
|
||||||
|
$data = [
|
||||||
|
'vehicles' => $make_data,
|
||||||
|
];
|
||||||
|
|
||||||
return new APIResponse(true, 'Vehicles loaded.', $data);
|
return new APIResponse(true, 'Vehicles loaded.', $data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\Warranty;
|
use App\Entity\Warranty;
|
||||||
use App\Entity\BatteryModel;
|
use App\Entity\BatteryModel;
|
||||||
|
|
@ -330,7 +330,7 @@ class WarrantyController extends ApiController
|
||||||
|
|
||||||
// get the api_user that made the call so that it gets added to the source
|
// get the api_user that made the call so that it gets added to the source
|
||||||
// source becomes CAPI_USER_<insert name of api user here>
|
// source becomes CAPI_USER_<insert name of api user here>
|
||||||
$username = $this->getAPIUsername($em, $user_id);
|
$username = $this->getUser()->getName();
|
||||||
$source = 'CAPI_USER_' . $username;
|
$source = 'CAPI_USER_' . $username;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||||
|
|
||||||
use Catalyst\ApiBundle\Controller\ApiController;
|
use Catalyst\ApiBundle\Controller\ApiController;
|
||||||
use Catalyst\ApiBundle\Response\APIResponse;
|
use Catalyst\ApiBundle\Component\Response as APIResponse;
|
||||||
|
|
||||||
use App\Entity\WarrantySerialQueue;
|
use App\Entity\WarrantySerialQueue;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue