controllers/location.go
@@ -98,6 +98,11 @@ if location.ParentId == 0 { tree = append(tree, location) } else { if _, ok := m[location.ParentId]; !ok { tree = append(tree, location) continue } m[location.ParentId].Children = make([]*models.Location, 0) m[location.ParentId].Children = append(m[location.ParentId].Children, location) } }