Skip to content

Commit b943921

Browse files
committed
Removed unnecessary functions from ai-assistant's /ingest route
1 parent 8f89384 commit b943921

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

ai-assistant/src/endpoints/ingest.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,6 @@ namespace Helpers {
3333
export async function insertNodes(db: IDB, nodes: DBNode[]) {
3434
await Promise.all(nodes.map((node) => insertNode(db, node)));
3535
}
36-
37-
async function establishRelation(
38-
db: IDB,
39-
sourceID: string,
40-
targetID: string,
41-
relation: string
42-
) {
43-
const query = [
44-
`MATCH (n { id: $sourceID })`,
45-
`MATCH (m { id: $targetID })`,
46-
`CREATE (n)-[:${relation}]->(m)\n`,
47-
].join("\n");
48-
try {
49-
await db.run(query, { sourceID, targetID });
50-
} catch (e) {
51-
console.error(e);
52-
}
53-
}
54-
55-
export async function establishRelations(db: IDB, nodes: DBNode[]) {
56-
const jobs: Promise<any>[] = [];
57-
for (const node of nodes) {
58-
for (const relation of node.relations) {
59-
const job = establishRelation(
60-
db,
61-
node.id,
62-
relation.target,
63-
relation.relation
64-
);
65-
jobs.push(job);
66-
}
67-
}
68-
await Promise.all(jobs);
69-
}
7036
}
7137

7238
export class IngestEndpoint extends ApiEndpoint {

0 commit comments

Comments
 (0)