fixed tests
This commit is contained in:
parent
93a23d9399
commit
43c32b7b58
@ -52,7 +52,9 @@ class CreateUser extends Job
|
||||
}
|
||||
|
||||
if ($this->request->has('companies')) {
|
||||
if (request()->isNotInstall()) {
|
||||
if (app()->runningInConsole() || request()->isInstall()) {
|
||||
$this->user->companies()->attach($this->request->get('companies'));
|
||||
} else {
|
||||
$user = user();
|
||||
|
||||
$companies = $user->withoutEvents(function () use ($user) {
|
||||
@ -62,8 +64,6 @@ class CreateUser extends Job
|
||||
if ($companies->isNotEmpty()) {
|
||||
$this->user->companies()->attach($companies->toArray());
|
||||
}
|
||||
} else {
|
||||
$this->user->companies()->attach($this->request->get('companies'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,9 @@ class UpdateUser extends Job
|
||||
}
|
||||
|
||||
if ($this->request->has('companies')) {
|
||||
if (app()->runningInConsole() || request()->isInstall()) {
|
||||
$this->user->companies()->attach($this->request->get('companies'));
|
||||
} else {
|
||||
$user = user();
|
||||
|
||||
$companies = $user->withoutEvents(function () use ($user) {
|
||||
@ -63,6 +66,7 @@ class UpdateUser extends Job
|
||||
$this->user->companies()->sync($companies->toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->user->contact) {
|
||||
$this->user->contact->update($this->request->input());
|
||||
|
Loading…
x
Reference in New Issue
Block a user