fix load data dealer base on user with pivot or not

This commit is contained in:
2025-07-10 12:24:11 +07:00
parent e59841fd23
commit b632996052
5 changed files with 223 additions and 19 deletions

View File

@@ -56,7 +56,8 @@ class ReportStockProductsController extends Controller
public function getDealers()
{
$dealers = Dealer::orderBy('name')->get(['id', 'name', 'dealer_code']);
$stockService = new StockReportService();
$dealers = $stockService->getDealersBasedOnUserRole();
return response()->json($dealers);
}