Skip to content

Fix issues on empty variable key & value and removed placeholder variables #1531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix issues on empty variable key & value and removed placeholder vari…
…ables
  • Loading branch information
Imiss-U1025 committed Feb 13, 2025
commit 5c160a8cb1dace8d29f239f7f906dba6a4729332
2 changes: 1 addition & 1 deletion client/packages/lowcoder/src/comps/queries/queryComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ QueryCompTmp = class extends QueryCompTmp {
}
if (action.type === CompActionTypes.EXECUTE_QUERY) {
if (getReduceContext().disableUpdateState) return this;
if(!action.args) action.args = this.children.variables.children.variables.toJsonValue().reduce((acc, curr) => Object.assign(acc, {[curr.key as string]:curr.value}), {});
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}), {});
action.args.$queryName = this.children.name.getView();

return this.executeQuery(action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ export function toQueryView(params: FunctionProperty[]) {
variables?: any;
timeout: InstanceType<ParamsControlType>;
}): Promise<QueryResult> => {
console.log("toQueryView props", props, params);
const { applicationId, isViewMode } = getGlobalSettings();

const mappedVariables = Object.keys(props.variables).map(key => ({key: `${props.args?.$queryName}.variables.${key}`, value: props.variables[key]}));
const mappedVariables = Object.keys(props.variables).filter(k => k !== "$queryName").map(key => ({key: `${props.args?.$queryName}.variables.${key}`, value: props.variables[key] || ""}));
let request: QueryExecuteRequest = {
path: props.applicationPath,
params: [
Expand Down
Loading