claims api retrieval tweaks

This commit is contained in:
Akinwale Ariwodola 2017-06-19 00:26:57 +01:00
parent 74932d02a2
commit 65924fdb3c

View file

@ -46,7 +46,7 @@ class ClaimsController extends AppController {
$conditions['Claims.Id <'] = $beforeId; $conditions['Claims.Id <'] = $beforeId;
} }
$claims = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['Name']]])->where($conditions)-> $claims = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['Name']]])->distinct(['Claims.ClaimId'])->where($conditions)->
limit($pageLimit)->order($order)->toArray(); limit($pageLimit)->order($order)->toArray();
return $this->_jsonResponse(['success' => true, 'claims' => $claims, 'total' => (int) $numClaims]); return $this->_jsonResponse(['success' => true, 'claims' => $claims, 'total' => (int) $numClaims]);