Browse Source

fix: check both title/column_name

pull/6974/head
Pranav C 1 year ago
parent
commit
7d1f3ec951
  1. 3
      packages/nocodb/src/helpers/getAst.ts
  2. 2
      packages/nocodb/src/services/datas.service.ts

3
packages/nocodb/src/helpers/getAst.ts

@ -68,7 +68,8 @@ const getAst = async ({
fields = Array.isArray(fields) ? fields : fields.split(',');
if (throwErrorIfInvalidParams) {
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) {
NcError.unprocessableEntity(
`Following fields are invalid: ${invalidFields.join(', ')}`,

2
packages/nocodb/src/services/datas.service.ts

@ -27,7 +27,7 @@ export class DatasService {
model,
view,
query: param.query,
throwErrorIfInvalidParams: true
throwErrorIfInvalidParams: true,
});
}

Loading…
Cancel
Save