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

Fixes for purge company and preserve settings

This commit is contained in:
David Bomba 2020-08-14 10:40:59 +10:00
parent 69264b34f3
commit dffb9be189
2 changed files with 5 additions and 4 deletions

View File

@ -143,9 +143,10 @@ class MigrationController extends BaseController
* ),
* )
*/
public function purgeCompanySaveSettings(Company $company)
public function purgeCompanySaveSettings(Request $request, Company $company)
{
$company->client->delete();
$company->clients()->delete();
$company->save();
return response()->json(['message' => 'Settings preserved'], 200);

View File

@ -411,8 +411,7 @@ class Company extends BaseModel
public function resolveRouteBinding($value)
{
return $this
->where('id', $this->decodePrimaryKey($value))->firstOrFail();
return $this->where('id', $this->decodePrimaryKey($value))->firstOrFail();
}
public function domain()
@ -445,4 +444,5 @@ class Company extends BaseModel
}
}
}