Skip to content
Snippets Groups Projects
Commit 4d54ac8d authored by Leonardo's avatar Leonardo
Browse files

fix: use direction enum for relation parsing

parent e624af9a
No related branches found
Tags v1.18.1
No related merge requests found
Pipeline #145206 passed
import type { RelationStruct } from 'ts-common';
import { getNodeCypher } from './node';
import type { QueryCacheData } from './model';
import { log } from 'ts-common/src/logger/logger';
export const NoNodeError = new Error('relation must have a node');
......
......@@ -14,7 +14,7 @@ import type {
} from 'ts-common/src/model/graphology';
import type { AllLogicStatement } from 'ts-common/src/model/query/logic/general';
import { QueryElementTypes } from 'ts-common/src/model/reactflow';
import { type QueryBuilderSettings, QueryUnionType } from 'ts-common/src/model/query/queryBuilderModel';
import { type QueryBuilderSettings, QueryRelationDirection, QueryUnionType } from 'ts-common/src/model/query/queryBuilderModel';
import { log } from '../../logger';
// Chunk extraction: traverse graph to find all paths of logic between relations and entities
......@@ -269,9 +269,9 @@ export function Query2BackendQuery(
depth: _currNode.depth,
direction: !_currNode.direction
? 'BOTH'
: _currNode.direction === 'right'
: _currNode.direction === QueryRelationDirection.RIGHT
? 'TO'
: _currNode.direction === 'left'
: _currNode.direction === QueryRelationDirection.LEFT
? 'FROM'
: 'BOTH',
node: chunk.length === position + 1 ? undefined : (processConnection(chunk, position + 1) as NodeStruct),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment