Skip to content

Commit

Permalink
createTree sets pid when it's given
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 4, 2021
1 parent 3c266a8 commit 6e518bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ func createTree(tx *sql.Tx, node *multitree.Node, parentID int64) (int64, error)
parents := current.Parents()
if len(parents) > 0 {
pid = parents[0].ID
} else {
pid = parentID
}
id, err := createNode(tx, current.Name, pid)
if err != nil {
Expand Down

0 comments on commit 6e518bd

Please sign in to comment.