mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:34:30 -04:00
Working on products api
This commit is contained in:
parent
1e8a4c2b70
commit
1f36e175dd
@ -29,11 +29,12 @@ class ProductApiController extends BaseAPIController
|
|||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$products = Product::scope()->withTrashed();
|
//$products = Product::scope()->withTrashed()->orderBy('created_at', 'desc')->paginate();
|
||||||
$products = $products->orderBy('created_at', 'desc')->paginate();
|
//$products = $products
|
||||||
|
|
||||||
|
$products = Product::scope()->withTrashed()->paginate();
|
||||||
$transformer = new ProductTransformer(\Auth::user()->account, $this->serializer);
|
$transformer = new ProductTransformer(\Auth::user()->account, $this->serializer);
|
||||||
$data = $this->includeCollection($products, $transformer, 'products', $products->paginate());
|
$data = $this->includeCollection($products, $transformer, 'products');
|
||||||
|
|
||||||
return $this->response($data);
|
return $this->response($data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user