fix: unable to call stored routines from query tabs

This commit is contained in:
Fabio Di Stasio 2021-01-19 19:14:11 +01:00
parent 8ff6e70145
commit 4923128236
1 changed files with 5 additions and 2 deletions

View File

@ -1088,6 +1088,9 @@ export class MySQLClient extends AntaresCore {
else { else {
const remappedFields = fields const remappedFields = fields
? fields.map(field => { ? fields.map(field => {
if (!field || Array.isArray(field))
return false;
return { return {
name: field.name, name: field.name,
orgName: field.orgName, orgName: field.orgName,
@ -1096,7 +1099,7 @@ export class MySQLClient extends AntaresCore {
orgTable: field.orgTable, orgTable: field.orgTable,
type: 'VARCHAR' type: 'VARCHAR'
}; };
}) }).filter(Boolean)
: []; : [];
if (args.details) { if (args.details) {
@ -1173,7 +1176,7 @@ export class MySQLClient extends AntaresCore {
} }
resolve({ resolve({
rows: Array.isArray(queryResult) ? queryResult : false, rows: Array.isArray(queryResult) ? queryResult.some(el => Array.isArray(el)) ? [] : queryResult : false,
report: !Array.isArray(queryResult) ? queryResult : false, report: !Array.isArray(queryResult) ? queryResult : false,
fields: fieldsArr.length ? fieldsArr : remappedFields, fields: fieldsArr.length ? fieldsArr : remappedFields,
keys: keysArr keys: keysArr