mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 14:49:38 +02:00
fix: remove transaction form controller (#2279)
This commit is contained in:
parent
a7438e5c78
commit
2fbd6cbc5d
2 changed files with 2 additions and 24 deletions
|
@ -1,22 +0,0 @@
|
|||
import {Controller} from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["expenseCategories", "incomeCategories"]
|
||||
|
||||
connect() {
|
||||
this.updateCategories()
|
||||
}
|
||||
|
||||
updateCategories(event) {
|
||||
const natureField = this.element.querySelector('input[name="account_entry[nature]"]:checked')
|
||||
const natureValue = natureField ? natureField.value : 'outflow'
|
||||
|
||||
if (natureValue === 'inflow') {
|
||||
this.expenseCategoriesTarget.classList.add('hidden')
|
||||
this.incomeCategoriesTarget.classList.remove('hidden')
|
||||
} else {
|
||||
this.expenseCategoriesTarget.classList.remove('hidden')
|
||||
this.incomeCategoriesTarget.classList.add('hidden')
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue