diff --git a/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php b/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php index c39bcb4..0548c88 100644 --- a/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php +++ b/app/Modules/Plan7/Http/Livewire/Plan7SelectorLivewire.php @@ -25,6 +25,9 @@ class Plan7SelectorLivewire extends Component public function mount() { $this->containerId = $this->containerId . '__' . $this->complexId; + $this->load(); + } + public function load() { if ($plan7ApiData = Complex::find($this->complexId)->getPlan7ApiData()) { $this->apiSummary = 'https://plan7.ru/catalog/exp/json/summary/?token=' . $plan7ApiData->token . '&zk=' . $plan7ApiData->zk; $this->apiAll = 'https://plan7.ru/catalog/exp/json/?token=' . $plan7ApiData->token . '&zk=' . $plan7ApiData->zk; @@ -32,10 +35,10 @@ public function mount() $this->getData(); } } - public function updated($property, $value) + public function updating($property, $value) { - if ($property === 'complexId') { - $this->mount(); + if ($property == 'complexId') { + $this->load(); } }