Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/components/RestAPI/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ const defaultState = {
};

const normalizeOrders = (orders: SortBy[]) => {
return (orders || []).reduce(
(acc, cur) => ({ ...acc, [cur.id]: cur.desc ? "desc" : "asc" }),
{}
);
// Drop the "no order selected" placeholder the query builder emits
// (`emptyCube.emptyKey`). The legacy Cube planner silently ignored the
// unresolvable member; the Tesseract planner rejects it with
// "Cannot resolve: emptyCube", which 500s the query.
return (orders || [])
.filter((cur) => cur.id && cur.id !== "emptyCube.emptyKey")
.reduce(
(acc, cur) => ({ ...acc, [cur.id]: cur.desc ? "desc" : "asc" }),
{}
);
};

const FORMAT_OPTIONS = [
Expand Down
14 changes: 10 additions & 4 deletions src/hooks/useFormatExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ interface UseFormatExportOptions {
}

const normalizeOrders = (orders: SortBy[]) => {
return (orders || []).reduce(
(acc, cur) => ({ ...acc, [cur.id]: cur.desc ? "desc" : "asc" }),
{}
);
// Drop the "no order selected" placeholder the query builder emits
// (`emptyCube.emptyKey`). The legacy Cube planner silently ignored the
// unresolvable member; the Tesseract planner rejects it with
// "Cannot resolve: emptyCube", which 500s the query.
return (orders || [])
.filter((cur) => cur.id && cur.id !== "emptyCube.emptyKey")
.reduce(
(acc, cur) => ({ ...acc, [cur.id]: cur.desc ? "desc" : "asc" }),
{}
);
};

const getFileNameFromDisposition = (header: string | null) => {
Expand Down