aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2019-04-19 13:40:47 +0200
committerPřemysl Janouch <p@janouch.name>2019-04-19 13:46:05 +0200
commit4ad4bcf9e706703fff64fde77f97ee4067a5765b (patch)
treec54563a4970a5cc0f7e90c8979aa89a4eeed7491
parent2d1e01a1a2503d9d3d7ba04e3873629f0300199e (diff)
downloadsklad-4ad4bcf9e706703fff64fde77f97ee4067a5765b.tar.gz
sklad-4ad4bcf9e706703fff64fde77f97ee4067a5765b.tar.xz
sklad-4ad4bcf9e706703fff64fde77f97ee4067a5765b.zip
sklad: fix index update when changing parent
-rw-r--r--cmd/sklad/db.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/sklad/db.go b/cmd/sklad/db.go
index 262a164..b58a5f2 100644
--- a/cmd/sklad/db.go
+++ b/cmd/sklad/db.go
@@ -225,7 +225,7 @@ func dbContainerUpdate(c *Container, updated Container) error {
}
indexChildren[c.Parent] = filterContainer(indexChildren[c.Parent], c)
- indexChildren[newID] = append(indexChildren[newID], c)
+ indexChildren[updated.Parent] = append(indexChildren[updated.Parent], c)
}
*c = updated
return dbCommit()