Merge pull request #2425 from mehmetcoban/master

show selected category on category component
This commit is contained in:
Cüneyt Şentürk 2022-06-06 14:20:55 +03:00 committed by GitHub
commit 349e86d299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,10 @@ class Category extends Form
$this->categories->put($model->category->id, $model->category->name);
}
if($model = $this->getParentData('model')) {
$this->selected = $model->category_id;
}
if (empty($this->selected) && (in_array($type, ['income', 'expense']))) {
$this->selected = setting('default.' . $type . '_category');
}