diff --git a/app/Models/Common/Company.php b/app/Models/Common/Company.php index c5d0452d7..2a521664c 100644 --- a/app/Models/Common/Company.php +++ b/app/Models/Common/Company.php @@ -319,7 +319,7 @@ class Company extends Eloquent $query = user()->companies()->usingSearchString($search)->sortable($sort); - if ($request->expectsJson()) { + if ($request->expectsJson() && $request->isNotApi()) { return $query->get(); }