forked from eatvio/eatvio-infra
refactor code style and code review
This commit is contained in:
@@ -5,8 +5,8 @@ namespace App\Livewire;
|
||||
use App\Models\Diary;
|
||||
use App\Models\Meal;
|
||||
use App\Models\Portion;
|
||||
use Livewire\Component;
|
||||
use Illuminate\View\View;
|
||||
use Livewire\Component;
|
||||
|
||||
class MealForm extends Component
|
||||
{
|
||||
@@ -42,11 +42,6 @@ class MealForm extends Component
|
||||
'portion' => 'required|min:1',
|
||||
];
|
||||
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['food-intake-updated' => '$refresh'];
|
||||
}
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->diary = Diary::find($this->diaryId);
|
||||
@@ -190,6 +185,11 @@ class MealForm extends Component
|
||||
$this->portions = array_values($filtered);
|
||||
}
|
||||
|
||||
protected function getListeners(): array
|
||||
{
|
||||
return ['food-intake-updated' => '$refresh'];
|
||||
}
|
||||
|
||||
private function addPortionIfItFilled(): void
|
||||
{
|
||||
if (mb_strlen($this->product_name) && $this->quantity && mb_strlen($this->portion)) {
|
||||
|
||||
Reference in New Issue
Block a user