handle some performance for app
This commit is contained in:
@@ -39,7 +39,15 @@ class ProductController extends SuperController
|
||||
}])->get();
|
||||
|
||||
// Prepare the response
|
||||
$user['rows'] = $products;
|
||||
$user['rows'] = $products->map(function ($product) {
|
||||
$product->unit = self::productQuantityUnit([
|
||||
'unit' => $product->unit ?? null,
|
||||
'direct_price' => $product->direct_price ?? null,
|
||||
'group_type' => $product->group_type ?? null,
|
||||
]);
|
||||
|
||||
return $product;
|
||||
});
|
||||
|
||||
return response()->json($user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user