actually update other fields than driver
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
This commit is contained in:
parent
9960578b11
commit
7ae0c3f263
1 changed files with 26 additions and 7 deletions
|
|
@ -90,17 +90,36 @@ class EntryComponent(
|
||||||
button(
|
button(
|
||||||
cls := "button is-success",
|
cls := "button is-success",
|
||||||
onClick --> {
|
onClick --> {
|
||||||
editClickBus.emit(entry.id, false)
|
val newDriver =
|
||||||
|
if driverInput.ref.value != entry.driver.payload then
|
||||||
|
entry.driver.write(driverInput.ref.value)
|
||||||
|
else entry.driver
|
||||||
|
val newStartKm =
|
||||||
|
if startKmInput.ref.value != entry.startKm.payload.toString then
|
||||||
|
entry.startKm.write(BigDecimal(startKmInput.ref.value))
|
||||||
|
else entry.startKm
|
||||||
|
val newEndKm =
|
||||||
|
if endKmInput.ref.value != entry.endKm.payload.toString then
|
||||||
|
entry.endKm.write(BigDecimal(endKmInput.ref.value))
|
||||||
|
else entry.endKm
|
||||||
|
val newAnimal =
|
||||||
|
if animalInput.ref.value != entry.animal.payload then
|
||||||
|
entry.animal.write(animalInput.ref.value)
|
||||||
|
else entry.animal
|
||||||
|
val newPaid =
|
||||||
|
if paidCheckbox.ref.checked != entry.paid.payload then
|
||||||
|
entry.paid.write(paidCheckbox.ref.checked)
|
||||||
|
else entry.paid
|
||||||
entryEditBus.emit(
|
entryEditBus.emit(
|
||||||
entry.copy(
|
entry.copy(
|
||||||
driver = entry.driver.write(driverInput.ref.value)
|
driver = newDriver,
|
||||||
// startKm =
|
startKm = newStartKm,
|
||||||
// entry.startKm.write(startKmInput.ref.value.toDouble),
|
endKm = newEndKm,
|
||||||
// endKm = entry.endKm.write(endKmInput.ref.value.toDouble),
|
animal = newAnimal,
|
||||||
// animal = entry.animal.write(animalInput.ref.value),
|
paid = newPaid
|
||||||
// paid = entry.paid.write(paidCheckbox.ref.checked)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
editClickBus.emit(entry.id, false)
|
||||||
},
|
},
|
||||||
span(
|
span(
|
||||||
cls := "icon edit",
|
cls := "icon edit",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue