Skip to content

Commit

Permalink
Merge pull request #2250 from evidence-dev/next
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
zachstence authored Jul 19, 2024
2 parents 2650ca2 + 60db596 commit e562cc3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/lib/component-utilities/src/checkInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,18 @@ export default function checkInputs(data, reqCols, optCols) {

// Get list of all columns in dataset
if (Query.isQuery(data)) {
for (const col of data.columns) {
columns.push(col.column_name);
// we want to handle cases where the columns have not yet been fetched, but the data is avialable
// this is most likely to happen during pre-rendering, because column metadata is not yet included
// in the prerendering process
if (!data.columnsLoaded && data.dataLoaded) {
const cols = Object.keys(data[0]);
for (const col of cols) {
columns.push(col);
}
} else {
for (const col of data.columns) {
columns.push(col.column_name);
}
}
} else {
for (const key of Object.keys(data[0])) {
Expand Down

0 comments on commit e562cc3

Please sign in to comment.