refactor: rewrite parameters of RQ hooks

This commit is contained in:
Rıdvan Akca
2024-03-14 13:54:51 +03:00
parent ba9d3afc88
commit 75df7d6413
6 changed files with 25 additions and 19 deletions

View File

@@ -40,12 +40,14 @@ function AddNewAppConnection(props) {
const [appName, setAppName] = React.useState('');
const [isLoading, setIsLoading] = React.useState(false);
const { data: apps, mutate } = useLazyApps({
appName,
onSuccess: () => {
setIsLoading(false);
const { data: apps, mutate } = useLazyApps(
{ appName },
{
onSuccess: () => {
setIsLoading(false);
},
},
});
);
const fetchData = React.useMemo(() => debounce(mutate, 300), [mutate]);

View File

@@ -161,17 +161,17 @@ function FlowStep(props) {
({ key }) => key === step.key,
);
const { data: triggerSubsteps } = useTriggerSubsteps(
app?.key,
actionOrTrigger?.key,
);
const { data: triggerSubsteps } = useTriggerSubsteps({
appKey: app?.key,
triggerKey: actionOrTrigger?.key,
});
const triggerSubstepsData = triggerSubsteps?.data || [];
const { data: actionSubsteps } = useActionSubsteps(
app?.key,
actionOrTrigger?.key,
);
const { data: actionSubsteps } = useActionSubsteps({
appKey: app?.key,
actionKey: actionOrTrigger?.key,
});
const actionSubstepsData = actionSubsteps?.data || [];