From 8dbcc16f2bb15a39b8ab5990f702f3afdbd671a3 Mon Sep 17 00:00:00 2001 From: Rob Mitchell <40571882+robertandremitchell@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:54:19 -0500 Subject: [PATCH] DB Creation fix (#331) Co-authored-by: fzhao99 Co-authored-by: Katie Campbell Downie --- query-connector/src/app/backend/dbCreation/db-creation.ts | 4 +--- query-connector/src/app/shared/database-service.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/query-connector/src/app/backend/dbCreation/db-creation.ts b/query-connector/src/app/backend/dbCreation/db-creation.ts index ac6199654..97c92ebeb 100644 --- a/query-connector/src/app/backend/dbCreation/db-creation.ts +++ b/query-connector/src/app/backend/dbCreation/db-creation.ts @@ -309,9 +309,7 @@ function readJsonFromRelativePath(filename: string) { try { // Re-scope file system reads to make sure we use the relative // path via node directory resolution - const runtimeServerPath = path.resolve( - path.join(__dirname, "/", "..", "/", "assets", "/", filename), - ); + const runtimeServerPath = path.join(__dirname, "../../assets/", filename); const data = fs.readFileSync(runtimeServerPath, "utf-8"); return data; } catch (error) { diff --git a/query-connector/src/app/shared/database-service.ts b/query-connector/src/app/shared/database-service.ts index d19bae910..7b4622c4c 100644 --- a/query-connector/src/app/shared/database-service.ts +++ b/query-connector/src/app/shared/database-service.ts @@ -7,7 +7,7 @@ import { DibbsValueSet, FhirServerConfig, CustomUserQuery, -} from "../shared/constants"; +} from "./constants"; import { encode } from "base-64"; import { CategoryToConditionArrayMap, @@ -33,7 +33,7 @@ import { updateNewbornScreeningCategorySql, ValuesetStruct, ValuesetToConceptStruct, -} from "../shared/seedSqlStructs"; +} from "./seedSqlStructs"; import { getDbClient } from "../backend/dbClient"; const getQuerybyNameSQL = `