1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Working on products api

This commit is contained in:
David Bomba 2016-01-30 22:20:09 +11:00
parent 32ed23cde7
commit b93cd84052

View File

@ -33,8 +33,10 @@ class ProductApiController extends BaseAPIController
//$products = $products //$products = $products
$products = Product::scope()->withTrashed(); $products = Product::scope()->withTrashed();
$paginator = Product::scope()->withTrashed()->paginate();
$transformer = new ProductTransformer(\Auth::user()->account, $this->serializer); $transformer = new ProductTransformer(\Auth::user()->account, $this->serializer);
$data = $this->createCollection($products, $transformer, 'products', $products->paginate()); $data = $this->createCollection($products, $transformer, 'products', $paginator);
return $this->response($data); return $this->response($data);