Skip to content

Commit e18fac7

Browse files
committed
[feat]: add params supports in the runQuery custom comp
1 parent 68150c9 commit e18fac7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

client/packages/lowcoder/src/comps/comps/customComp/customComp.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const defaultCode = `
4545
<Space>
4646
<Button
4747
type="primary"
48-
onClick={() => runQuery(model.query)}
48+
onClick={() => runQuery({ queryName: model.query })}
4949
>
5050
${trans("customComp.triggerQuery")}
5151
</Button>
@@ -104,10 +104,11 @@ function InnerCustomComponent(props: IProps) {
104104

105105
const methodsRef = useRef({
106106
runQuery: async (data: any) => {
107-
const { queryName } = data;
107+
108+
const { queryName, params } = data.queryName;
108109
return getPromiseAfterDispatch(
109110
dispatch,
110-
routeByNameAction(queryName, executeQueryAction({}))
111+
routeByNameAction(queryName, executeQueryAction({ args: params }))
111112
).catch((error) => Promise.resolve({}));
112113
},
113114

0 commit comments

Comments
 (0)