mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 05:34:34 -04:00
Fixes for purge company and preserve settings
This commit is contained in:
parent
69264b34f3
commit
dffb9be189
@ -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();
|
$company->save();
|
||||||
|
|
||||||
return response()->json(['message' => 'Settings preserved'], 200);
|
return response()->json(['message' => 'Settings preserved'], 200);
|
||||||
|
@ -411,8 +411,7 @@ class Company extends BaseModel
|
|||||||
|
|
||||||
public function resolveRouteBinding($value)
|
public function resolveRouteBinding($value)
|
||||||
{
|
{
|
||||||
return $this
|
return $this->where('id', $this->decodePrimaryKey($value))->firstOrFail();
|
||||||
->where('id', $this->decodePrimaryKey($value))->firstOrFail();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function domain()
|
public function domain()
|
||||||
@ -445,4 +444,5 @@ class Company extends BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user