Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 155bab4

Browse files
Merge pull request #1531 from lowcoder-org/fix/variables_issue_s3
Fix issues on empty variable key & value and removed placeholder variables
2 parents f934eda + 5c160a8 commit 155bab4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ QueryCompTmp = class extends QueryCompTmp {
363363
}
364364
if (action.type === CompActionTypes.EXECUTE_QUERY) {
365365
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}), {});
366+
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}), {});
367367
action.args.$queryName = this.children.name.getView();
368368

369369
return this.executeQuery(action);

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

Lines changed: 1 addition & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /