Compare commits
3 Commits
74677d12c4
...
9ca24a266a
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ca24a266a | |||
| e7a0a3ff21 | |||
| f40a4acad1 |
@@ -46,8 +46,9 @@ export const runDatamartQuery = async (data: Data) => {
|
|||||||
|
|
||||||
// create the query with no changed just to have it here
|
// create the query with no changed just to have it here
|
||||||
let datamartQuery = queryInfo[0]?.query || "";
|
let datamartQuery = queryInfo[0]?.query || "";
|
||||||
|
|
||||||
// split the criteria by "," then and then update the query
|
// split the criteria by "," then and then update the query
|
||||||
if (data.options) {
|
if (data.options !== "") {
|
||||||
const params = new URLSearchParams(data.options);
|
const params = new URLSearchParams(data.options);
|
||||||
|
|
||||||
for (const [rawKey, rawValue] of params.entries()) {
|
for (const [rawKey, rawValue] of params.entries()) {
|
||||||
|
|||||||
@@ -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.
|
// just sending a get on datamart will return all the queries that we can call.
|
||||||
app.get(`${baseUrl}/api/datamart`, async (_, res) => {
|
app.get(`${baseUrl}/api/datamart`, async (_, res) => {
|
||||||
const queries = await db
|
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)
|
.from(datamart)
|
||||||
.where(eq(datamart.active, true));
|
.where(eq(datamart.active, true));
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { returnFunc } from "../utils/returnHelper.utils.js";
|
import { returnFunc } from "../utils/returnHelper.utils.js";
|
||||||
import {
|
import {
|
||||||
closePool,
|
|
||||||
connected,
|
connected,
|
||||||
pool,
|
pool,
|
||||||
reconnecting,
|
reconnecting,
|
||||||
@@ -64,7 +63,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
|
|||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const err = error as SqlError;
|
const err = error as SqlError;
|
||||||
if (err.code === "ETIMEOUT") {
|
if (err.code === "ETIMEOUT") {
|
||||||
closePool();
|
|
||||||
return returnFunc({
|
return returnFunc({
|
||||||
success: false,
|
success: false,
|
||||||
module: "system",
|
module: "system",
|
||||||
@@ -77,7 +75,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err.code === "EREQUEST") {
|
if (err.code === "EREQUEST") {
|
||||||
closePool();
|
|
||||||
return returnFunc({
|
return returnFunc({
|
||||||
success: false,
|
success: false,
|
||||||
module: "system",
|
module: "system",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"dev:app": "cd backend && tsx watch server.ts",
|
"dev:app": "cd backend && tsx watch server.ts",
|
||||||
"dev:db:migrate": "npx drizzle-kit push",
|
"dev:db:migrate": "npx drizzle-kit push",
|
||||||
"dev:db:generate": "tsc && npx drizzle-kit generate --config=drizzle.config.ts",
|
"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:app": "tsc",
|
||||||
"build:docker": "docker compose up --force-recreate --build -d",
|
"build:docker": "docker compose up --force-recreate --build -d",
|
||||||
"lint": "tsc && biome lint",
|
"lint": "tsc && biome lint",
|
||||||
|
|||||||
Reference in New Issue
Block a user