Skip to content

Commit

Permalink
fix: get srcId when path has no relationship
Browse files Browse the repository at this point in the history
mod: code reiview
  • Loading branch information
hetao92 committed May 18, 2022
1 parent be56f43 commit a0e2d12
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ccore/nebula/gateway/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ func getPathInfo(valWarp *wrapper.ValueWrapper, data map[string]types.Any) (map[
_relationships = append(_relationships, _relation)
}
data["relationships"] = _relationships
if len(relationships) == 0 {
nodes := path.GetNodes()
if len(nodes) > 0 {
startNode := nodes[0]
data["srcID"] = getID(startNode.GetID())
}
}
return data, nil
}

Expand Down

0 comments on commit a0e2d12

Please sign in to comment.