Resolve "RESQ 2: Fix API responses in CAPI calls" #1674

Merged
korina.cordero merged 1 commit from 749-resq-2-fix-api-responses-in-capi-calls into 746-resq-2-0-final 2023-07-18 06:20:55 +00:00
9 changed files with 13 additions and 11 deletions

View file

@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\SAPBattery;
use App\Entity\SAPBatterySize;

View file

@ -9,7 +9,6 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Catalyst\ApiBundle\Controller\ApiController;
//use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\Customer;

View file

@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Service\RisingTideGateway;
use App\Service\WarrantyAPILogger;

View file

@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\Dealer;

View file

@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\Municipality;

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\PrivacyPolicy;

View file

@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\Vehicle;
use App\Entity\VehicleManufacturer;
@ -48,7 +48,7 @@ class VehicleController extends ApiController
{
$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
if ($mfg == null)
@ -69,6 +69,9 @@ class VehicleController extends ApiController
}
// TODO: need to add manufacturer details
$data = [
'vehicles' => $make_data,
];
return new APIResponse(true, 'Vehicles loaded.', $data);
}

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\Warranty;
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
// source becomes CAPI_USER_<insert name of api user here>
$username = $this->getAPIUsername($em, $user_id);
$username = $this->getUser()->getName();
$source = 'CAPI_USER_' . $username;

View file

@ -11,7 +11,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Catalyst\ApiBundle\Controller\ApiController;
use Catalyst\ApiBundle\Response\APIResponse;
use Catalyst\ApiBundle\Component\Response as APIResponse;
use App\Entity\WarrantySerialQueue;