3 Commits

4 changed files with 10 additions and 6 deletions

View File

@@ -46,8 +46,9 @@ export const runDatamartQuery = async (data: Data) => {
// create the query with no changed just to have it here
let datamartQuery = queryInfo[0]?.query || "";
// split the criteria by "," then and then update the query
if (data.options) {
if (data.options !== "") {
const params = new URLSearchParams(data.options);
for (const [rawKey, rawValue] of params.entries()) {

View File

@@ -17,7 +17,13 @@ export const setupDatamartRoutes = (baseUrl: string, app: Express) => {
// just sending a get on datamart will return all the queries that we can call.
app.get(`${baseUrl}/api/datamart`, async (_, res) => {
const queries = await db
.select()
.select({
name: datamart.name,
description: datamart.description,
options: datamart.options,
version: datamart.version,
upd_date: datamart.upd_date,
})
.from(datamart)
.where(eq(datamart.active, true));

View File

@@ -1,6 +1,5 @@
import { returnFunc } from "../utils/returnHelper.utils.js";
import {
closePool,
connected,
pool,
reconnecting,
@@ -64,7 +63,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
} catch (error: unknown) {
const err = error as SqlError;
if (err.code === "ETIMEOUT") {
closePool();
return returnFunc({
success: false,
module: "system",
@@ -77,7 +75,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
}
if (err.code === "EREQUEST") {
closePool();
return returnFunc({
success: false,
module: "system",

View File

@@ -9,7 +9,7 @@
"dev:app": "cd backend && tsx watch server.ts",
"dev:db:migrate": "npx drizzle-kit push",
"dev:db:generate": "tsc && npx drizzle-kit generate --config=drizzle.config.ts",
"build": "npm run specCheck && npm run lint && npm run dev:db:generate && npm run dev:db:migrate && npm run build:app",
"build": "npm run specCheck && npm run lint && npm run dev:db:generate && npm run dev:db:migrate && npm run build:app && npm run build:docker",
"build:app": "tsc",
"build:docker": "docker compose up --force-recreate --build -d",
"lint": "tsc && biome lint",