Skip to content

Commit

Permalink
fix: only add is_set if ids are expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Feb 1, 2023
1 parent e81dee9 commit 9970d13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ exports.TRAPIQueryHandler = class TRAPIQueryHandler {
debug(log_msg);
this.logs.push(new LogEntry('INFO', null, log_msg).getLog());

const foundExpandedIds = expanded.length > queryGraph.nodes[nodeId].ids.length;
queryGraph.nodes[nodeId].ids = expanded;

const nodeMissingIsSet = !queryGraph.nodes[nodeId].hasOwnProperty('is_set') || !queryGraph.nodes[nodeId].is_set;

//make sure is_set is true
if (!queryGraph.nodes[nodeId].hasOwnProperty('is_set') || !queryGraph.nodes[nodeId].is_set) {
if (foundExpandedIds && nodeMissingIsSet) {
queryGraph.nodes[nodeId].is_set = true;
log_msg = `Added is_set:true to node ${nodeId}`;
debug(log_msg);
Expand Down

0 comments on commit 9970d13

Please sign in to comment.