refactor(api): finalize report query utility split
This commit is contained in:
@@ -19,7 +19,6 @@ import {
|
|||||||
buildWhere,
|
buildWhere,
|
||||||
csvEscape,
|
csvEscape,
|
||||||
type EntityKey,
|
type EntityKey,
|
||||||
FilterSchema,
|
|
||||||
flattenRow,
|
flattenRow,
|
||||||
getValidScalarField,
|
getValidScalarField,
|
||||||
reportEntitySchema,
|
reportEntitySchema,
|
||||||
@@ -28,7 +27,7 @@ import {
|
|||||||
type ReportQueryResult,
|
type ReportQueryResult,
|
||||||
validateReportInput,
|
validateReportInput,
|
||||||
} from "./report-query-config.js";
|
} from "./report-query-config.js";
|
||||||
import { COLUMN_MAP, type ColumnDef, RESOURCE_MONTH_COLUMNS } from "./report-columns.js";
|
import { COLUMN_MAP, RESOURCE_MONTH_COLUMNS } from "./report-columns.js";
|
||||||
import {
|
import {
|
||||||
buildReportGroups,
|
buildReportGroups,
|
||||||
matchesInMemoryFilter,
|
matchesInMemoryFilter,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { ColumnDef } from "./report-columns.js";
|
|
||||||
import type { FilterInput, ReportGroupSummary } from "./report-query-config.js";
|
import type { FilterInput, ReportGroupSummary } from "./report-query-config.js";
|
||||||
|
import type { ColumnDef } from "./report-columns.js";
|
||||||
|
|
||||||
function parseFilterValue(def: ColumnDef | undefined, value: string): unknown {
|
function parseFilterValue(def: ColumnDef | undefined, value: string): unknown {
|
||||||
if (!def) {
|
if (!def) {
|
||||||
@@ -71,7 +71,6 @@ export function sortInMemoryRows(
|
|||||||
if (!groupBy && !sortBy) {
|
if (!groupBy && !sortBy) {
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...rows].sort((left, right) => {
|
return [...rows].sort((left, right) => {
|
||||||
if (groupBy) {
|
if (groupBy) {
|
||||||
const groupDef = columns.find((column) => column.key === groupBy);
|
const groupDef = columns.find((column) => column.key === groupBy);
|
||||||
|
|||||||
Reference in New Issue
Block a user