|
|
@ -68,7 +68,10 @@ const getAst = async ({ |
|
|
|
fields = Array.isArray(fields) ? fields : fields.split(','); |
|
|
|
fields = Array.isArray(fields) ? fields : fields.split(','); |
|
|
|
if (throwErrorIfInvalidParams) { |
|
|
|
if (throwErrorIfInvalidParams) { |
|
|
|
const colAliasMap = await model.getColAliasMapping(); |
|
|
|
const colAliasMap = await model.getColAliasMapping(); |
|
|
|
const invalidFields = fields.filter((f) => !colAliasMap[f]); |
|
|
|
const aliasColMap = await model.getAliasColMapping(); |
|
|
|
|
|
|
|
const invalidFields = fields.filter( |
|
|
|
|
|
|
|
(f) => !colAliasMap[f] && !aliasColMap[f], |
|
|
|
|
|
|
|
); |
|
|
|
if (invalidFields.length) { |
|
|
|
if (invalidFields.length) { |
|
|
|
NcError.unprocessableEntity( |
|
|
|
NcError.unprocessableEntity( |
|
|
|
`Following fields are invalid: ${invalidFields.join(', ')}`, |
|
|
|
`Following fields are invalid: ${invalidFields.join(', ')}`, |
|
|
|