Skip to content

Commit d4f474f

Browse files
committed
saving work
1 parent 20601c5 commit d4f474f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/lundjrl/chef
22

3-
go 1.23.0
4-
5-
toolchain go1.24.4
3+
go 1.25.4
64

75
require (
86
github.com/charmbracelet/bubbles v0.21.0

main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,17 @@ func (m mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
111111
m.TextInput.Cursor.SetMode(cursor.New().Mode())
112112
}
113113
case "2":
114-
selected := m.Table.SelectedRow()
115-
id := selected[0]
114+
id := string(rune(m.Table.Cursor()))
116115
count := 2 // count should be a dynamic string
117116

118117
db.UpdateInventoryItem(id, count)
118+
rows := m.Table.Rows()
119+
120+
row := m.Table.SelectedRow()
121+
row[2] = "2"
122+
rows[0] = row
123+
124+
m.Table.SetRows(rows)
119125
case "tab":
120126
switch m.State {
121127
case shared.TableView:

0 commit comments

Comments
 (0)