This PR solves an issue related to Prospect reports, that occurred when one or more prospects had no contact associated.
Before
All the prospects without contact were presented in one row:
In this screenshot, we can see the prospect with IDs 2790 and 2791 mixed in the same row, with 25 random contacts appearing on the contact column. There are 25 because of the default limit on the API call.
After
The prospects without contacts are not displayed.
Technical Details
This chained API call inside the Prospect.get is causing the problem:
Overview
This PR solves an issue related to Prospect reports, that occurred when one or more prospects had no contact associated.
Before
All the prospects without contact were presented in one row:
In this screenshot, we can see the prospect with IDs 2790 and 2791 mixed in the same row, with 25 random contacts appearing on the contact column. There are 25 because of the default limit on the API call.
After
The prospects without contacts are not displayed.
Technical Details
This chained API call inside the Prospect.get is causing the problem:
because
$value.client_id
is null on the Case data. For solving this, we should filter by Cases having client:Also, the
getCount
method was modified, since it should return all the matching results on the same query.