Skip to content

Commit

Permalink
fix: get srcId when path has no relationship (#115)
Browse files Browse the repository at this point in the history
mod: code reiview

Co-authored-by: Nut He <18328704+hetao92@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and hetao92 committed May 18, 2022
1 parent cb342db commit 316a5f6
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 316a5f6

Please sign in to comment.