1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fix for weird output array after deleting company

This commit is contained in:
David Bomba 2020-06-25 07:36:39 +10:00
parent 887559e048
commit 83a3a4a2c7

View File

@ -57,7 +57,7 @@ class CompanyController extends BaseController
protected $company_repo;
public $forced_includes = [];
public $forced_includes = [];
/**
* CompanyController constructor.
@ -466,14 +466,9 @@ class CompanyController extends BaseController
*/
public function destroy(DestroyCompanyRequest $request, Company $company)
{
info(print_r($request->all()));
info("destroying {$company->present()->name()} - {$company->hashed_id}");
$company_count = $company->account->companies->count();
$account = $company->account;
info("company count = {$company_count}");
if ($company_count == 1) {
$company->company_users->each(function ($company_user) {
@ -499,7 +494,9 @@ class CompanyController extends BaseController
$account->save();
}
}
ob_flush();
return response()->json(['message' => 'success'], 200);
}
}