Fix the response when no latest jo. #632
This commit is contained in:
parent
65c0ad1c56
commit
1030b1934e
1 changed files with 4 additions and 1 deletions
|
|
@ -3823,9 +3823,12 @@ class APIController extends Controller implements LoggedController
|
||||||
// get the latest job order for customer
|
// get the latest job order for customer
|
||||||
$latest_jo = $em->getRepository(JobOrder::class)->findOneBy(['customer' => $cust], ['id' => 'DESC']);
|
$latest_jo = $em->getRepository(JobOrder::class)->findOneBy(['customer' => $cust], ['id' => 'DESC']);
|
||||||
|
|
||||||
$jo_data = [];
|
$jo_data = null;
|
||||||
if ($latest_jo != null)
|
if ($latest_jo != null)
|
||||||
|
{
|
||||||
|
// TODO: clean the response up to just return what is needed
|
||||||
$jo_data = $this->generateJobOrderData($req, $latest_jo, $rt);
|
$jo_data = $this->generateJobOrderData($req, $latest_jo, $rt);
|
||||||
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'latest_job_order' => $jo_data,
|
'latest_job_order' => $jo_data,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue