diff --git a/app/Ninja/Datatables/VendorDatatable.php b/app/Ninja/Datatables/VendorDatatable.php index fda61fe457d8..93e059b6ae55 100644 --- a/app/Ninja/Datatables/VendorDatatable.php +++ b/app/Ninja/Datatables/VendorDatatable.php @@ -74,6 +74,6 @@ class VendorDatatable extends EntityDatatable ] ]; } - + } diff --git a/app/Services/DatatableService.php b/app/Services/DatatableService.php index 453f4d0f25b0..8fa49df5f7df 100644 --- a/app/Services/DatatableService.php +++ b/app/Services/DatatableService.php @@ -8,7 +8,6 @@ use App\Ninja\Datatables\EntityDatatable; class DatatableService { - //public function createDatatable($entityType, $query, $columns, $actions = null, $showCheckbox = true, $orderColumns = []) public function createDatatable(EntityDatatable $datatable, $query) { $table = Datatable::query($query); diff --git a/app/Services/VendorService.php b/app/Services/VendorService.php index 7477300036d7..0940be420cb4 100644 --- a/app/Services/VendorService.php +++ b/app/Services/VendorService.php @@ -8,6 +8,7 @@ use App\Models\Expense; use App\Services\BaseService; use App\Ninja\Repositories\VendorRepository; use App\Ninja\Repositories\NinjaRepository; +use App\Ninja\Datatables\VendorDatatable; class VendorService extends BaseService { @@ -37,13 +38,14 @@ class VendorService extends BaseService public function getDatatable($search) { + $datatable = new VendorDatatable(); $query = $this->vendorRepo->find($search); if(!Utils::hasPermission('view_all')){ $query->where('vendors.user_id', '=', Auth::user()->id); } - return $this->datatableService->createDatatable(ENTITY_VENDOR, $query); + return $this->datatableService->createDatatable($datatable, $query); } }