Skip to content

Commit abb850a

Browse files
committed
Fix issues on empty variable key & value and removed placeholder variables
1 parent f934eda commit abb850a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

client/packages/lowcoder/src/comps/queries/queryComp.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,9 @@ QueryCompTmp = class extends QueryCompTmp {
362362
return this.processEvents(action.value.result);
363363
}
364364
if (action.type === CompActionTypes.EXECUTE_QUERY) {
365+
console.log(this.children.variables.children.variables.toJsonValue());
365366
if (getReduceContext().disableUpdateState) return this;
366-
if(!action.args) action.args = this.children.variables.children.variables.toJsonValue().reduce((acc, curr) => Object.assign(acc, {[curr.key as string]:curr.value}), {});
367+
if(!action.args) action.args = this.children.variables.children.variables.toJsonValue().filter(kv => kv.key).reduce((acc, curr) => Object.assign(acc, {[curr.key as string]:curr.value}), {});
367368
action.args.$queryName = this.children.name.getView();
368369

369370
return this.executeQuery(action);

client/packages/lowcoder/src/comps/queries/queryCompUtils.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ export function toQueryView(params: FunctionProperty[]) {
2828
variables?: any;
2929
timeout: InstanceType<ParamsControlType>;
3030
}): Promise<QueryResult> => {
31-
console.log("toQueryView props", props, params);
3231
const { applicationId, isViewMode } = getGlobalSettings();
3332

34-
const mappedVariables = Object.keys(props.variables).map(key => ({key: `${props.args?.$queryName}.variables.${key}`, value: props.variables[key]}));
33+
const mappedVariables = Object.keys(props.variables).filter(k => k !== "$queryName").map(key => ({key: `${props.args?.$queryName}.variables.${key}`, value: props.variables[key] || ""}));
3534
let request: QueryExecuteRequest = {
3635
path: props.applicationPath,
3736
params: [

0 commit comments

Comments
 (0)