refactor(datamart): refactored the get queries to only send back info not the entire query

This commit is contained in:
2026-01-13 17:56:43 -06:00
parent 74677d12c4
commit f40a4acad1
2 changed files with 9 additions and 2 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));