salesentry filters
This commit is contained in:
@ -148,4 +148,17 @@ class ProductController extends Controller
|
||||
'data' => $productModel,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getProductsByCategory(Request $request)
|
||||
{
|
||||
$categoryId = $request->category_id;
|
||||
try {
|
||||
$products = $this->productRepository->getProductsByCategory($categoryId);
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return response()->json(['products' => $products]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user