mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 00:00:46 +00:00
fix(frontend): fix snowflake columnsDefs (#3377)
This commit is contained in:
@@ -341,6 +341,7 @@
|
||||
if (!gridItem) return
|
||||
|
||||
let columnDefs = gridItem.data.configuration.columnDefs as StaticInput<TableMetadata>
|
||||
|
||||
let old: TableMetadata = (columnDefs?.value as TableMetadata) ?? []
|
||||
if (!Array.isArray(old)) {
|
||||
console.log('old is not an array RESET')
|
||||
|
||||
@@ -183,9 +183,9 @@ order by c.ORDINAL_POSITION;`
|
||||
attempts = maxRetries
|
||||
|
||||
if (resourceType === 'ms_sql_server') {
|
||||
return testResult.result[0]
|
||||
return lowercaseKeys(testResult.result[0])
|
||||
} else {
|
||||
return testResult.result
|
||||
return lowercaseKeys(testResult.result)
|
||||
}
|
||||
} else {
|
||||
attempts++
|
||||
@@ -209,6 +209,16 @@ export function resourceTypeToLang(rt: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function lowercaseKeys(arr: Array<Record<string, any>>): Array<any> {
|
||||
return arr.map((obj) => {
|
||||
const newObj = {}
|
||||
Object.keys(obj).forEach((key) => {
|
||||
newObj[key.toLowerCase()] = obj[key]
|
||||
})
|
||||
return newObj
|
||||
})
|
||||
}
|
||||
|
||||
const scripts: Record<
|
||||
string,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user