Skip to content

Commit

Permalink
feat: base query builder validation
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-w committed Aug 8, 2024
1 parent da07cce commit a4d9fa3
Show file tree
Hide file tree
Showing 14 changed files with 400 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class BaseQueryService {
.$queryRawUnsafe<{ [key in string]: unknown }[]>(query)
.catch((e) => {
this.logger.error(e);
throw new BadRequestException(`Query failed: ${query}`);
throw new BadRequestException(`Query failed: ${query}, ${e.message}`);
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class QuerySelect {
if (field && getQueryColumnTypeByFieldInstance(field) === BaseQueryColumnType.Field) {
if (cur.alias) {
acc[cur.alias] = field.dbFieldName;
currentFieldMap[cur.column].name = cur.alias;
currentFieldMap[cur.column].dbFieldName = cur.alias;
} else {
const alias = `${field.id}_${field.name}`;
Expand Down
4 changes: 3 additions & 1 deletion packages/common-i18n/src/locales/en/sdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,9 @@
"add": "Add",
"error": {
"invalidCol": "Invalid column, please reselect",
"invalidCols": "Invalid columns: {{colNames}}"
"invalidCols": "Invalid columns: {{colNames}}",
"invalidTable": "Invalid table, please reselect",
"requiredSelect": "You must select one"
},
"from": {
"title": "From",
Expand Down
4 changes: 3 additions & 1 deletion packages/common-i18n/src/locales/zh/sdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,9 @@
"add": "添加",
"error": {
"invalidCol": "无效的列,请重新选择",
"invalidCols": "无效的列:{{colNames}}"
"invalidCols": "无效的列:{{colNames}}",
"invalidTable": "无效的表格,请重新选择",
"requiredSelect": "必须选择一个"
},
"from": {
"title": "来源",
Expand Down
Loading

0 comments on commit a4d9fa3

Please sign in to comment.